/* =========================================================
   Color Party — ninety6 studio
   Dark arcade shell, bright paper canvas, hard-offset UI.
   ========================================================= */

/* Fredoka (SIL Open Font License, see fonts/Fredoka-OFL.txt), bundled so the
   game looks the same everywhere without calling a font server. */
@font-face {
  font-family: "Fredoka";
  src: url("fonts/fredoka-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --void: #0e0e1a;
  --navy: #131629;
  --slate: #1a1a2e;
  --p1: #2979ff;
  --p2: #39ff14;
  --p3: #ff3e9d;
  --p4: #ffd23f;
  --orange: #ff6b3d;
  --purple: #8f5bff;
  --teal: #00e5d0;
  --white: #ffffff;
  --grey: #9aa0b5;
  --ink: #2a2440;
  --paper: #fffcf3;
  --accent: #ff3e9d;

  /* bundled font only: Playables may not call external URLs */
  --display: "Fredoka", ui-rounded, "Arial Rounded MT Bold", "Varela Round", "Nunito", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --body: "Fredoka", ui-rounded, "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;

  --line: #000;
  --shadow: 0 6px 0 #000;
  --radius: 18px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--body);
  color: var(--white);
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(41, 121, 255, 0.18), transparent 60%),
    radial-gradient(800px 500px at 92% 8%, rgba(255, 62, 157, 0.14), transparent 60%),
    radial-gradient(700px 700px at 50% 120%, rgba(0, 229, 208, 0.1), transparent 60%),
    var(--void);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.5px;
}

button {
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

#app {
  position: relative;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

/* ---------------- screens ---------------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.995);
  transition: opacity 0.26s ease, transform 0.26s ease, visibility 0.26s;
  pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom);
}
.screen.active {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  z-index: 2;
}

/* ---------------- top bar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  flex: 0 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
}
.brand b {
  color: var(--grey);
  font-weight: 800;
}
.quad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 24px;
  height: 24px;
  padding: 2px;
  border: 2px solid #000;
  border-radius: 7px;
  background: #0b0b14;
}
.quad i {
  border-radius: 2px;
}
.quad i:nth-child(1) { background: var(--p1); }
.quad i:nth-child(2) { background: var(--p2); }
.quad i:nth-child(3) { background: var(--p3); }
.quad i:nth-child(4) { background: var(--p4); }

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  position: relative;
  width: 46px;
  height: 46px;
  min-width: 46px;
  display: grid;
  place-items: center;
  font-size: 19px;
  background: var(--slate);
  border: 2px solid #000;
  border-radius: 14px;
  box-shadow: 0 4px 0 #000;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s;
  touch-action: manipulation;
}
.icon-btn:hover {
  background: #24243c;
}
.icon-btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #000;
}
.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  background: var(--p3);
  color: #1a0010;
  border: 2px solid #000;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 900;
}

.topbar-title {
  min-width: 0;
}
.topbar-title h2 {
  font-size: 24px;
  line-height: 1.1;
}
.topbar-title p {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--grey);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.spacer {
  flex: 1;
}

/* ---------------- home ---------------- */
.home {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 6px 18px 40px;
  flex: 1;
}

.hero {
  text-align: center;
  padding: 12px 0 22px;
  position: relative;
}
.hero-art {
  font-size: 54px;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.55));
  animation: bob 3.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-7px) rotate(3deg); }
}
.hero h1 {
  font-size: clamp(44px, 11vw, 78px);
  line-height: 0.98;
  color: var(--white);
  text-shadow: 0 6px 0 #000;
}
.hero h1 .accent {
  color: var(--p3);
  text-shadow: 0 6px 0 #000;
}
.tagline {
  margin: 10px auto 0;
  max-width: 460px;
  color: var(--grey);
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.5;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.mode-card {
  --accent: #2979ff;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 14px 12px;
  min-height: 84px;
  background: linear-gradient(160deg, #1b1c33, #14152a);
  border: 2px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  box-shadow: 0 5px 0 #000, 0 0 0 1px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.2s;
  position: relative;
  overflow: hidden;
}
.mode-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.85;
}
.mode-card::before {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -50px;
  top: -50px;
  background: radial-gradient(circle, var(--accent), transparent 65%);
  opacity: 0.22;
  pointer-events: none;
}
.mode-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #000;
}
.mode-card:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #000;
}
.mode-icon {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  font-size: 24px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 24%, #101020);
  border: 2px solid rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.mode-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mode-copy b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.3px;
  line-height: 1.1;
}
.mode-copy small {
  font-size: 11.5px;
  color: var(--grey);
  font-weight: 600;
  line-height: 1.25;
}
.mode-go {
  margin-left: auto;
  font-size: 11px;
  color: var(--accent);
  opacity: 0.8;
}

.home-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.pill {
  flex: 1 1 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  min-height: 50px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.7);
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}
.pill b {
  font-weight: 900;
  color: var(--p4);
}
.pill:hover {
  background: rgba(255, 255, 255, 0.09);
}
.pill:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}
.footnote {
  text-align: center;
  color: #5d6380;
  font-size: 11.5px;
  font-weight: 600;
  margin: 22px 0 0;
  letter-spacing: 0.03em;
}

/* ---------------- age bands ---------------- */
.band-block {
  margin: 2px 0 16px;
}
.band-label {
  margin: 0 0 9px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey);
}
.band-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.band-card {
  --bc: #39ff14;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  padding: 11px 11px 12px;
  background: linear-gradient(160deg, #191a2e, #121327);
  border: 2px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  box-shadow: 0 4px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s, border-color 0.15s;
  position: relative;
  overflow: hidden;
}
.band-card::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--bc);
  opacity: 0.55;
}
.band-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}
.band-card:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #000;
}
.band-card.active {
  border-color: var(--bc);
  box-shadow: 0 4px 0 #000, 0 0 0 2px var(--bc), 0 0 26px -8px var(--bc);
}
.band-card.active::before {
  opacity: 1;
}
.band-age {
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
  color: var(--bc);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.6);
}
.band-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.band-copy b {
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.band-copy small {
  font-size: 10px;
  color: var(--grey);
  font-weight: 600;
  line-height: 1.25;
}

/* 4–6: everything bigger, fewer choices */
body.band-little .mode-card {
  min-height: 98px;
  padding: 16px 14px;
}
body.band-little .mode-copy b {
  font-size: 19px;
}
body.band-little .mode-copy small {
  font-size: 12px;
}
body.band-little .mode-icon {
  width: 58px;
  height: 58px;
  font-size: 28px;
}
body.band-little .swatch {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 17px;
}
body.band-little .chip {
  min-height: 52px;
  padding: 11px 17px;
  font-size: 14px;
}
body.band-little .icon-btn {
  width: 52px;
  height: 52px;
  min-width: 52px;
  font-size: 21px;
}
body.band-little .stage::after {
  opacity: 0.18;
}
body.band-little .band-copy small {
  display: none;
}
body.band-little .band-card {
  padding: 10px 11px 12px;
}

/* 13+: slightly denser chrome */
body.band-teen .mode-card {
  min-height: 80px;
}
body.band-teen .band-copy small {
  font-size: 9.5px;
}

/* custom colour picker swatch */
.swatch.custom {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: conic-gradient(
    from 210deg,
    #ff3e9d,
    #ffd23f,
    #39ff14,
    #00e5d0,
    #2979ff,
    #8f5bff,
    #ff3e9d
  );
  cursor: pointer;
}
.swatch.custom::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 9px;
  background: var(--c, #24243c);
  border: 2px solid rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.swatch.custom input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

/* ---------------- tabs + art grid ---------------- */
.tabs {
  display: flex;
  gap: 8px;
  padding: 4px 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  white-space: nowrap;
  font-weight: 800;
  font-size: 13.5px;
  background: var(--slate);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--grey);
  transition: 0.15s;
}
.tab span {
  font-size: 16px;
}
.tab.active {
  color: #101020;
  background: var(--p4);
  border-color: #000;
  box-shadow: 0 3px 0 #000;
}

.art-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 4px 18px 40px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}
.art-card {
  padding: 10px 10px 12px;
  background: linear-gradient(160deg, #1b1c33, #14152a);
  border: 2px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  box-shadow: 0 5px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.art-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #000;
}
.art-card:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #000;
}
.art-thumb {
  position: relative;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: var(--paper);
}
.art-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.art-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 9px;
  border-radius: 99px;
  background: #0b0b16;
  color: var(--p2);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.06em;
  border: 2px solid rgba(0, 0, 0, 0.6);
}
.art-name {
  font-family: var(--display);
  font-size: 16.5px;
  padding-left: 4px;
}
.empty-note {
  text-align: center;
  color: var(--grey);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.6;
  max-width: 380px;
  margin: 40px auto;
  padding: 0 20px;
}

/* ---------------- studio ---------------- */
#screen-studio {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.studio-bar {
  gap: 8px;
  padding-left: 12px;
  padding-right: 12px;
}
.studio-bar .topbar-actions {
  gap: 6px;
}
.studio-bar .icon-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  font-size: 17px;
  border-radius: 12px;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.progress-ring {
  --p: 0;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--p2) 0deg, rgba(255, 255, 255, 0.13) 0deg);
  display: grid;
  place-items: center;
  position: relative;
  border: 2px solid #000;
  box-shadow: 0 3px 0 #000;
  transition: filter 0.2s;
}
.progress-ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--navy);
}
.progress-ring span {
  position: relative;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.progress-ring.full {
  box-shadow: 0 0 18px rgba(57, 255, 20, 0.55), 0 3px 0 #000;
}
.studio-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.studio-title b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-title span {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  min-height: 48px;
  font-weight: 900;
  font-size: 14.5px;
  border: 2px solid #000;
  border-radius: 15px;
  box-shadow: 0 5px 0 #000;
  color: #0b0b16;
  background: var(--p1);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
  letter-spacing: 0.01em;
}
.btn:hover {
  filter: brightness(1.08);
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #000;
}
.btn-small {
  min-height: 42px;
  padding: 8px 15px;
  font-size: 13.5px;
  border-radius: 12px;
  box-shadow: 0 4px 0 #000;
}
.btn-p1 { background: var(--p1); color: #041028; }
.btn-p2 { background: var(--p2); color: #032000; }
.btn-p3 { background: var(--p3); color: #24000f; }
.btn-p4 { background: var(--p4); color: #241a00; }
.btn-ghost {
  background: var(--slate);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 5px 0 #000;
}
#btn-done.ready {
  animation: readyPulse 1.4s ease-in-out infinite;
}
@keyframes readyPulse {
  0%, 100% { box-shadow: 0 4px 0 #000, 0 0 0 rgba(57, 255, 20, 0); }
  50% { box-shadow: 0 4px 0 #000, 0 0 22px rgba(57, 255, 20, 0.65); }
}

.studio-main {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 6px 10px;
  overflow: hidden;
}

.stage {
  position: relative;
  width: 320px;
  height: 320px;
  max-width: 100%;
  max-height: 100%;
  background: var(--paper);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 0 0 3px #000, 0 14px 0 rgba(0, 0, 0, 0.45),
    0 30px 70px -24px rgba(0, 0, 0, 0.95);
  isolation: isolate;
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background-image: radial-gradient(rgba(42, 36, 64, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.35;
  mix-blend-mode: multiply;
  border-radius: inherit;
}
body[data-mode="glow"] .stage::after {
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  mix-blend-mode: screen;
  opacity: 0.5;
}
#paint {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  z-index: 1;
}
.badges {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.num-badge {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(24px, 7.5%, 36px);
  height: clamp(24px, 7.5%, 36px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c, #ffd23f);
  color: #201a06;
  font-weight: 900;
  font-size: clamp(11px, 2.4vw, 15px);
  border: 2.5px solid #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  transition: opacity 0.25s, transform 0.25s;
}
.num-badge.done {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
}
.hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translate(-50%, 10px);
  max-width: 90%;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(11, 11, 22, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 4;
  backdrop-filter: blur(6px);
}
.hint.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* toolbar */
.toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(19, 22, 41, 0.92);
  border-top: 2px solid #000;
  backdrop-filter: blur(12px);
  max-height: 46dvh;
  overflow-y: auto;
  scrollbar-width: none;
}
.toolbar::-webkit-scrollbar {
  display: none;
}
[hidden] {
  display: none !important;
}
.tool-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
}
.tool-row.wraps {
  flex-wrap: wrap;
}
.tool-row.palette {
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
  gap: 7px;
}
.tool-row.palette::-webkit-scrollbar {
  display: none;
}

.swatch {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 14px;
  background: var(--c);
  border: 2px solid rgba(0, 0, 0, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 3px 0 rgba(0, 0, 0, 0.55);
  transition: transform 0.1s, box-shadow 0.1s;
  position: relative;
}
.swatch:active {
  transform: scale(0.94);
}
.swatch.active {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #000, 0 4px 0 rgba(0, 0, 0, 0.6);
  z-index: 2;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 13px;
  font-size: 12.5px;
  font-weight: 800;
  background: var(--slate);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  color: var(--grey);
  box-shadow: 0 3px 0 #000;
  transition: 0.12s;
}
.chip span {
  font-size: 15px;
}
.chip:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #000;
}
.chip.active {
  color: #0b0b16;
  background: var(--p4);
  border-color: #000;
}
.chip.tool.active {
  background: var(--p1);
  color: #041028;
}

.size-label {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
}
#size-input {
  flex: 1;
  height: 40px;
  appearance: none;
  background: transparent;
}
#size-input::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.32));
  border: 2px solid #000;
}
#size-input::-webkit-slider-thumb {
  appearance: none;
  width: 34px;
  height: 34px;
  margin-top: -14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #000;
  box-shadow: 0 2px 0 #000;
  cursor: grab;
}
#size-input::-moz-range-track {
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.25);
}
#size-input::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #000;
}
.size-preview {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.1);
}
.size-preview i {
  display: block;
  border-radius: 50%;
  background: var(--white);
}

.stickers {
  gap: 6px;
}
.sticker-btn {
  width: 46px;
  height: 46px;
  font-size: 22px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: 0.12s;
}
.sticker-btn.active {
  background: var(--p4);
  border-color: #000;
}

.numbers-legend {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
}
.legend-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 40px;
  flex: 0 0 auto;
}
.legend-chip b {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid #fff;
  color: #1a1405;
  font-size: 12px;
}
.legend-chip i {
  display: block;
  width: 22px;
  height: 8px;
  border-radius: 99px;
  background: var(--c);
  border: 1.5px solid rgba(0, 0, 0, 0.5);
}

/* wider studio (tablet / desktop) */
@media (min-width: 900px) and (orientation: landscape) {
  #screen-studio {
    grid-template-columns: minmax(0, 1fr) 350px;
    grid-template-rows: auto minmax(0, 1fr);
  }
  #screen-studio .studio-bar {
    grid-column: 1 / -1;
  }
  #screen-studio .studio-main {
    grid-column: 1;
    grid-row: 2;
    padding: 14px 20px 22px;
  }
  #screen-studio .toolbar {
    grid-column: 2;
    grid-row: 2;
    border-top: 0;
    border-left: 2px solid #000;
    max-height: none;
    justify-content: center;
    gap: 14px;
    padding: 18px 16px;
  }
  #screen-studio .tool-row.palette {
    flex-wrap: wrap;
    overflow: visible;
    justify-content: center;
  }
  #screen-studio .tool-row.wraps {
    justify-content: center;
  }
  .stage {
    box-shadow: 0 0 0 3px #000, 0 18px 0 rgba(0, 0, 0, 0.45),
      0 40px 80px -20px rgba(0, 0, 0, 0.95);
  }
}

/* tall screens: bigger art grid */
@media (min-width: 700px) and (orientation: portrait) {
  .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .art-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1000px) {
  .mode-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .art-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------------- gallery ---------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 8px 16px 40px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}
.gallery-card {
  padding: 8px;
  background: var(--slate);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 5px 0 #000;
  text-align: left;
  transition: transform 0.1s, box-shadow 0.1s;
}
.gallery-card:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #000;
}
.gallery-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: var(--paper);
}
.gallery-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 4px 2px;
}
.gallery-meta b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 15px;
}
.gallery-meta small {
  color: var(--grey);
  font-size: 10.5px;
  font-weight: 700;
}

/* ---------------- treasures ---------------- */
.box-banner {
  margin: 6px 16px 16px;
  padding: 18px;
  max-width: 900px;
  width: calc(100% - 32px);
  align-self: center;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: linear-gradient(140deg, rgba(255, 210, 63, 0.16), rgba(143, 91, 255, 0.14));
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 5px 0 #000;
}
.boxes-count {
  font-family: var(--display);
  font-size: 46px;
  line-height: 1;
  color: var(--p4);
  text-shadow: 0 4px 0 #000;
}
.boxes-label {
  font-weight: 800;
  font-size: 14px;
  color: var(--white);
}
.boxes-hint {
  font-size: 12px;
  color: var(--grey);
  font-weight: 600;
  flex-basis: 100%;
}
.box-banner .btn {
  margin-left: auto;
}
.treasure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  padding: 0 16px 40px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}
.treasure-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--slate);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 4px 0 #000;
  text-align: center;
}
.treasure-emoji {
  font-size: 30px;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.4));
}
.treasure-card b {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}
.treasure-card small {
  color: var(--p4);
  font-weight: 900;
  font-size: 11px;
}

/* ---------------- modal ---------------- */
#modal-root {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
}
#modal-root.open {
  display: block;
}
.modal-back {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 14, 0.72);
  backdrop-filter: blur(7px);
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-y: auto;
}
.modal-card {
  width: min(420px, 100%);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  background: linear-gradient(170deg, #1d1e36, #14152a);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow: 0 10px 0 #000, 0 30px 70px -20px rgba(0, 0, 0, 0.9);
  padding: 18px;
  text-align: center;
  margin: auto;
}
.modal-card.pop {
  animation: modalPop 0.28s cubic-bezier(0.2, 1.5, 0.4, 1);
}
@keyframes modalPop {
  from { transform: scale(0.88) translateY(14px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal-sub {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
}
.modal-title {
  font-size: 27px;
  line-height: 1.1;
  margin-bottom: 8px;
}
.modal-body {
  margin: 6px 0 4px;
}
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 16px;
}
.complete-img {
  height: min(32vh, 260px);
  width: min(32vh, 260px);
  object-fit: contain;
  margin: 0 auto 10px;
  border-radius: 16px;
  border: 3px solid #000;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.5);
  background: var(--paper);
}
.stars {
  font-size: 28px;
  letter-spacing: 4px;
  line-height: 1;
  margin: 4px 0 8px;
}
.complete-msg {
  color: var(--grey);
  font-size: 13px;
  font-weight: 600;
  margin: 6px 0;
  line-height: 1.5;
}
.complete-gift {
  font-weight: 800;
  font-size: 14px;
  color: var(--p4);
  margin: 8px 0 0;
}

/* gifts */
.gift-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 0 4px;
}
.gift-box {
  font-size: 88px;
  line-height: 1;
  cursor: pointer;
  filter: drop-shadow(0 10px 0 rgba(0, 0, 0, 0.45));
  animation: boxWobble 1.3s ease-in-out infinite;
  transition: transform 0.2s;
  user-select: none;
}
.gift-box:hover {
  transform: scale(1.08);
}
@keyframes boxWobble {
  0%, 100% { transform: rotate(-4deg) scale(1); }
  50% { transform: rotate(4deg) scale(1.04); }
}
.gift-tap {
  color: var(--grey);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 4px 0 0;
}
.gift-reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0 2px;
}
.gift-emoji {
  font-size: 84px;
  line-height: 1.1;
  filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.4));
  animation: revealPop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes revealPop {
  from { transform: scale(0.3) rotate(-16deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.gift-name {
  font-family: var(--display);
  font-size: 22px;
}
.gift-rarity {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 99px;
  border: 2px solid #000;
}
.gift-rarity.common { background: var(--grey); color: #101020; }
.gift-rarity.rare { background: var(--p1); color: #041028; }
.gift-rarity.epic { background: var(--p3); color: #24000f; }

.gallery-view img {
  width: 100%;
  max-height: 38vh;
  object-fit: contain;
  border-radius: 16px;
  border: 3px solid #000;
  background: var(--paper);
}

/* ---------------- toast / confetti ---------------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: #0b0b16;
  border: 2px solid var(--p2);
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  padding: 11px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 90;
  max-width: 88vw;
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
body[data-screen="studio"] #toast {
  top: calc(74px + env(safe-area-inset-top));
  bottom: auto;
  transform: translate(-50%, -14px);
}
body[data-screen="studio"] #toast.show {
  transform: translate(-50%, 0);
}
#modal-root.open ~ #toast {
  opacity: 0;
}

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  transition: opacity 0.2s;
}
#confetti.show {
  opacity: 1;
}

/* very small phones */
@media (max-width: 380px) {
  .studio-title { display: none; }
  .studio-bar .topbar-actions { gap: 4px; }
  .studio-bar .icon-btn { width: 38px; height: 38px; min-width: 38px; font-size: 15px; }
  .btn-small { padding: 7px 11px; }
  .mode-copy b { font-size: 15px; }
  .mode-card { padding: 12px 10px; gap: 9px; }
  .mode-icon { width: 42px; height: 42px; font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   SUNNY THEME (kid-friendly reskin) + new components
   Bright sky, white "sticker" cards with chunky ink outlines.
   Everything below overrides the dark arcade shell above.
   ========================================================= */
:root {
  --ink-line: #2a2440;
  --text: #2a2440;
  --muted: #6e6790;
  --card: #ffffff;
  --card-2: #fff7e6;
  --ring: #2eb872;
  --ring-empty: #ece6f7;
  --grey: #6e6790;
  --white: #2a2440;
  --slate: #ffffff;
  --navy: #ffffff;
  --p2: #2eb872;
  --sun: #ffd23f;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 8% 14%, rgba(255, 255, 255, 0.85) 0 46px, transparent 47px),
    radial-gradient(circle at 15% 12%, rgba(255, 255, 255, 0.85) 0 34px, transparent 35px),
    radial-gradient(circle at 88% 20%, rgba(255, 255, 255, 0.8) 0 40px, transparent 41px),
    radial-gradient(circle at 94% 18%, rgba(255, 255, 255, 0.8) 0 28px, transparent 29px),
    linear-gradient(180deg, #8fd3ff 0%, #bfe8ff 46%, #fff1c9 100%);
  background-attachment: fixed;
}

/* ---------- splash ---------- */
#splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(180deg, #8fd3ff 0%, #fff1c9 100%);
  color: var(--text);
  font-family: var(--display);
  transition: opacity 0.4s ease, visibility 0.4s;
}
#splash.gone {
  opacity: 0;
  visibility: hidden;
}
.splash-logo {
  font-size: 72px;
  animation: bob 1.6s ease-in-out infinite;
}
.splash-title,
.rainbow-title {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: 1px;
}
.splash-title {
  font-size: clamp(36px, 9vw, 64px);
}
.splash-title span,
.rainbow-title span {
  display: inline-block;
  -webkit-text-stroke: 2px var(--ink-line);
  text-shadow: 0 5px 0 var(--ink-line);
}
.splash-title span:nth-child(5n + 1),
.rainbow-title span:nth-child(5n + 1) { color: #ff5a5f; }
.splash-title span:nth-child(5n + 2),
.rainbow-title span:nth-child(5n + 2) { color: #ffb020; }
.splash-title span:nth-child(5n + 3),
.rainbow-title span:nth-child(5n + 3) { color: #2eb872; }
.splash-title span:nth-child(5n + 4),
.rainbow-title span:nth-child(5n + 4) { color: #2979ff; }
.splash-title span:nth-child(5n + 5),
.rainbow-title span:nth-child(5n + 5) { color: #8f5bff; }
.rainbow-title span {
  animation: letterHop 2.8s ease-in-out infinite;
}
.rainbow-title span:nth-child(2) { animation-delay: 0.1s; }
.rainbow-title span:nth-child(3) { animation-delay: 0.2s; }
.rainbow-title span:nth-child(4) { animation-delay: 0.3s; }
.rainbow-title span:nth-child(5) { animation-delay: 0.4s; }
.rainbow-title span:nth-child(6) { animation-delay: 0.5s; }
.rainbow-title span:nth-child(7) { animation-delay: 0.6s; }
.rainbow-title span:nth-child(8) { animation-delay: 0.7s; }
.rainbow-title span:nth-child(9) { animation-delay: 0.8s; }
.rainbow-title span:nth-child(10) { animation-delay: 0.9s; }
@keyframes letterHop {
  0%, 70%, 100% { transform: translateY(0); }
  80% { transform: translateY(-8px) rotate(-4deg); }
}
.splash-bar {
  width: min(260px, 70vw);
  height: 18px;
  border: 3px solid var(--ink-line);
  border-radius: 99px;
  background: #fff;
  overflow: hidden;
}
.splash-bar i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 99px;
  background: repeating-linear-gradient(-45deg, #ff5a5f 0 12px, #ffb020 12px 24px, #2eb872 24px 36px, #2979ff 36px 48px);
  animation: loadSlide 1.1s ease-in-out infinite alternate;
}
@keyframes loadSlide {
  from { transform: translateX(-60%); }
  to { transform: translateX(210%); }
}
#splash p {
  margin: 0;
  font-weight: 800;
  color: var(--muted);
  font-family: var(--body);
}

/* ---------- shared surfaces ---------- */
.brand { color: var(--text); }
.quad { background: #fff; border-color: var(--ink-line); }
.icon-btn,
.tab,
.chip,
.pill,
.btn-ghost,
.sticker-btn,
.size-preview,
.gallery-card,
.treasure-card,
.art-card,
.mode-card,
.band-card,
.modal-card {
  background: var(--card);
  color: var(--text);
  border: 3px solid var(--ink-line);
  box-shadow: 0 5px 0 var(--ink-line);
}
.icon-btn:hover,
.pill:hover {
  background: #fffbe8;
}
.icon-btn:active,
.chip:active,
.pill:active,
.art-card:active,
.mode-card:active,
.band-card:active,
.gallery-card:active {
  box-shadow: 0 1px 0 var(--ink-line);
}
.icon-btn.off {
  opacity: 0.55;
  filter: grayscale(1);
}
.badge {
  border-color: var(--ink-line);
  color: #fff;
}

.hero h1 {
  color: var(--text);
  text-shadow: none;
  font-size: clamp(44px, 11vw, 82px);
}
.hero-art {
  filter: drop-shadow(0 6px 0 rgba(42, 36, 64, 0.35));
}
.tagline {
  color: var(--text);
  font-weight: 800;
  font-size: 16px;
}

/* progress strip */
.home-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: -6px 0 16px;
}
.home-stats span {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 7px 12px;
  border: 3px solid var(--ink-line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 3px 0 var(--ink-line);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.home-stats b {
  font-size: 15px;
  color: var(--text);
}

/* levels */
.band-label {
  color: var(--text);
  font-size: 12px;
}
.band-card {
  background: var(--card);
}
.band-card:hover {
  border-color: var(--ink-line);
}
.band-card.active {
  background: color-mix(in srgb, var(--bc) 22%, #fff);
  border-color: var(--ink-line);
  box-shadow: 0 5px 0 var(--ink-line), 0 0 0 4px var(--bc);
}
.band-card::before {
  height: 6px;
}
.band-age {
  color: var(--text);
  text-shadow: none;
  font-size: 19px;
  font-weight: 900;
}
.band-copy small {
  color: var(--muted);
  font-size: 11px;
}

/* modes */
.mode-card {
  background: var(--card);
  border-color: var(--ink-line);
}
.mode-card:hover {
  border-color: var(--ink-line);
  box-shadow: 0 7px 0 var(--ink-line);
}
.mode-card::after {
  height: 7px;
  opacity: 1;
}
.mode-card::before {
  opacity: 0.35;
}
.mode-card.featured {
  background: color-mix(in srgb, var(--accent) 14%, #fff);
}
.mode-icon {
  background: color-mix(in srgb, var(--accent) 30%, #fff);
  border: 3px solid var(--ink-line);
  box-shadow: none;
  font-size: 26px;
}
.mode-copy b {
  font-weight: 900;
  color: var(--text);
}
.mode-copy small {
  color: var(--muted);
}
.mode-go {
  color: var(--text);
  opacity: 0.6;
}
.mode-tag {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--accent);
  border: 2px solid var(--ink-line);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill b {
  color: #e2007a;
}
.pill {
  background: var(--card);
}

/* topbars / titles */
.topbar-title h2 {
  color: var(--text);
  font-weight: 900;
}
.topbar-title p {
  color: var(--muted);
}

/* tabs + picture cards */
.tab {
  color: var(--muted);
  box-shadow: 0 3px 0 var(--ink-line);
}
.tab.active {
  background: var(--sun);
  color: var(--text);
  border-color: var(--ink-line);
}
.art-card {
  background: var(--card);
}
.art-card:hover {
  border-color: var(--ink-line);
  box-shadow: 0 7px 0 var(--ink-line);
}
.art-thumb {
  border: 3px solid var(--ink-line);
}
.art-name {
  color: var(--text);
  font-weight: 900;
}
.art-badge {
  background: #fff;
  color: var(--text);
  border: 2px solid var(--ink-line);
}
.mini-stars {
  color: #ffb020;
  letter-spacing: 1px;
  font-size: 13px;
}
.mini-stars i {
  font-style: normal;
  color: #d9d3e8;
}
.art-card.locked .art-thumb img {
  filter: grayscale(1) blur(2px);
  opacity: 0.55;
}
.lock-veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 38px;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.25));
}
.art-card.locked .art-name {
  color: var(--muted);
}
.nudge {
  animation: nudge 0.42s ease;
}
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px) rotate(-2deg); }
  45% { transform: translateX(6px) rotate(2deg); }
  70% { transform: translateX(-4px); }
}

/* ---------- studio ---------- */
.progress-ring {
  border-color: var(--ink-line);
  box-shadow: 0 3px 0 var(--ink-line);
}
.progress-ring::before {
  background: #fff;
}
.progress-ring span {
  color: var(--text);
}
.progress-ring.full {
  box-shadow: 0 0 0 4px rgba(46, 184, 114, 0.35), 0 3px 0 var(--ink-line);
}
.studio-title b {
  color: var(--text);
  font-weight: 900;
}
.studio-title span {
  color: color-mix(in srgb, var(--accent) 70%, #2a2440);
}
.stage {
  box-shadow: 0 0 0 4px var(--ink-line), 0 12px 0 rgba(42, 36, 64, 0.25);
}
.toolbar {
  background: rgba(255, 252, 240, 0.94);
  border-top: 3px solid var(--ink-line);
}
@media (min-width: 900px) and (orientation: landscape) {
  #screen-studio .toolbar {
    border-left: 3px solid var(--ink-line);
  }
  .stage {
    box-shadow: 0 0 0 4px var(--ink-line), 0 14px 0 rgba(42, 36, 64, 0.25);
  }
}
.swatch {
  border: 3px solid var(--ink-line);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 3px 0 var(--ink-line);
}
.swatch.active {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink-line), 0 4px 0 var(--ink-line);
}
.chip {
  color: var(--text);
  box-shadow: 0 3px 0 var(--ink-line);
  border-width: 2px;
}
.chip.active {
  background: var(--sun);
  border-color: var(--ink-line);
  color: var(--text);
}
.chip.tool.active {
  background: #7db8ff;
  color: var(--text);
}
.size-label {
  color: var(--muted);
}
#size-input::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #e9e3f5, #cfc6e6);
  border-color: var(--ink-line);
}
.size-preview i {
  background: var(--text);
}
.sticker-btn.active {
  background: var(--sun);
}
.hint {
  background: #fff;
  color: var(--text);
  border: 3px solid var(--ink-line);
  box-shadow: 0 4px 0 var(--ink-line);
  font-size: 13.5px;
  font-weight: 800;
  backdrop-filter: none;
}
body[data-mode="glow"] .hint {
  background: #1d1b33;
  color: #fff;
}
.btn {
  border: 3px solid var(--ink-line);
  box-shadow: 0 5px 0 var(--ink-line);
  color: var(--text);
}
.btn:active {
  box-shadow: 0 1px 0 var(--ink-line);
}
.btn-p1 { background: #7db8ff; color: var(--text); }
.btn-p2 { background: #5fd38f; color: var(--text); }
.btn-p3 { background: #ff8fc4; color: var(--text); }
.btn-p4 { background: var(--sun); color: var(--text); }
.btn-ghost { background: #fff; }
#btn-done.ready {
  animation: readyPulseSun 1.2s ease-in-out infinite;
}
@keyframes readyPulseSun {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* number badges on the picture */
.num-badge {
  border: 3px solid var(--ink-line);
  color: var(--text);
  box-shadow: 0 2px 0 var(--ink-line);
}
.num-badge.sel {
  z-index: 2;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink-line);
  animation: badgeBeat 1s ease-in-out infinite;
}
@keyframes badgeBeat {
  0%, 100% { transform: translate(-50%, -50%) scale(1.1); }
  50% { transform: translate(-50%, -50%) scale(1.28); }
}
.num-badge.done {
  animation: none;
}
.num-badge.nudge {
  animation: badgeNudge 0.45s ease;
}
@keyframes badgeNudge {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  30% { transform: translate(calc(-50% - 7px), -50%) scale(1.3); }
  60% { transform: translate(calc(-50% + 6px), -50%) scale(1.3); }
}

/* number picker (legend) */
.numbers-legend {
  gap: 8px;
}
.legend-chip {
  width: auto;
  min-width: 58px;
  padding: 6px 6px 5px;
  gap: 3px;
  border: 3px solid var(--ink-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 0 var(--ink-line);
  cursor: pointer;
  position: relative;
  transition: transform 0.1s;
  font-family: inherit;
}
.legend-chip b {
  width: 34px;
  height: 34px;
  font-size: 17px;
  font-weight: 900;
  border: 3px solid var(--ink-line);
  color: var(--text);
}
.legend-chip small {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  max-width: 64px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.legend-chip.active {
  background: color-mix(in srgb, var(--c) 35%, #fff);
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink-line), 0 6px 0 var(--ink-line);
}
.legend-chip.done {
  opacity: 0.5;
}
.legend-chip.done::after {
  content: "✓";
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #2eb872;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  border: 2px solid var(--ink-line);
}
body.band-little .legend-chip b {
  width: 44px;
  height: 44px;
  font-size: 22px;
}

/* tracing banner */
.trace-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  margin: 0 auto;
  padding: 8px 16px;
  border: 3px solid var(--ink-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 0 var(--ink-line);
}
.trace-banner span {
  grid-row: 1 / 3;
  font-size: 30px;
}
.trace-banner b {
  font-size: 15px;
  font-weight: 900;
}
.trace-banner small {
  color: var(--muted);
  font-weight: 700;
}

/* "Pink ears" word pop */
.word-pop {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  padding: 5px 12px;
  border-radius: 999px;
  border: 3px solid var(--ink-line);
  background: #fff;
  color: var(--text);
  font-weight: 900;
  font-size: clamp(13px, 2.4vmin, 18px);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 3px 0 var(--ink-line);
  animation: wordFloat 1.5s ease-out forwards;
}
.word-pop.new {
  background: #fff3b0;
}
@keyframes wordFloat {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, -60%) scale(1.08); }
  70% { opacity: 1; transform: translate(-50%, -110%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -150%) scale(0.95); }
}

/* ---------- modals ---------- */
.modal-back {
  background: rgba(42, 36, 64, 0.45);
  backdrop-filter: blur(4px);
}
.modal-card {
  background: #fffdf5;
  box-shadow: 0 10px 0 var(--ink-line);
}
.modal-title {
  color: var(--text);
  font-weight: 900;
}
.modal-sub,
.complete-msg,
.gift-tap {
  color: var(--muted);
}
.complete-img {
  border-color: var(--ink-line);
  box-shadow: 0 5px 0 rgba(42, 36, 64, 0.35);
}
.stars i {
  font-style: normal;
  color: #d9d3e8;
}
.fact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  border: 3px dashed #8f5bff;
  border-radius: 16px;
  background: #f3edff;
  text-align: left;
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 700;
}
.fact b {
  color: #6a3fe0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.complete-unlock {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 14px;
  background: #e5f8ee;
  border: 2px solid #2eb872;
  font-weight: 700;
  font-size: 13.5px;
}
.complete-gift {
  color: #c2410c;
}
.gift-name {
  color: var(--text);
}
.gift-rarity.common { background: #e9e3f5; color: var(--text); }
.gift-rarity.rare { background: #7db8ff; color: var(--text); }
.gift-rarity.epic { background: #ff8fc4; color: var(--text); }

/* gallery / treasures */
.gallery-meta b { color: var(--text); }
.gallery-meta small { color: var(--muted); }
.box-banner {
  background: linear-gradient(140deg, #fff3b0, #f3edff);
  border: 3px solid var(--ink-line);
  box-shadow: 0 5px 0 var(--ink-line);
}
.boxes-count {
  color: #ffb020;
  -webkit-text-stroke: 2px var(--ink-line);
  text-shadow: 0 4px 0 var(--ink-line);
}
.boxes-label { color: var(--text); }
.treasure-card small { color: #c2410c; }
.empty-note { color: var(--muted); }
.empty-note.small {
  grid-column: 1 / -1;
  margin: 8px auto;
  font-size: 12.5px;
}
.gallery-view img {
  border-color: var(--ink-line);
}

/* toast */
#toast {
  background: #fff;
  border: 3px solid var(--ink-line);
  color: var(--text);
  box-shadow: 0 4px 0 var(--ink-line);
}

/* ---------- YouTube pause: freeze everything ---------- */
body.paused #app,
body.paused #modal-root {
  pointer-events: none;
}
body.paused *,
body.paused *::before,
body.paused *::after {
  animation-play-state: paused !important;
}

/* ---------- extreme aspect ratios (Playables: 9:16 to 32:9) ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { padding: 4px 0 8px; }
  .hero-art { display: none; }
  .hero h1 { font-size: clamp(30px, 7vh, 48px); }
  .tagline { margin-top: 4px; font-size: 13px; }
  .home-stats { margin: 0 0 8px; }
  #screen-studio {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 34vw);
    grid-template-rows: auto minmax(0, 1fr);
  }
  #screen-studio .studio-bar { grid-column: 1 / -1; padding-top: 6px; padding-bottom: 6px; }
  #screen-studio .studio-main { grid-column: 1; grid-row: 2; padding: 6px; }
  #screen-studio .toolbar {
    grid-column: 2;
    grid-row: 2;
    max-height: none;
    border-top: 0;
    border-left: 3px solid var(--ink-line);
    justify-content: center;
  }
  #screen-studio .tool-row.palette { flex-wrap: wrap; overflow: visible; justify-content: center; }
  #screen-studio .tool-row.wraps { justify-content: center; }
}
@media (min-aspect-ratio: 21/9) {
  .home { max-width: 1200px; }
  .mode-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .art-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); max-width: 1400px; }
}
@media (max-aspect-ratio: 10/16) {
  .mode-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- narrow phones: keep the studio header inside the screen ---------- */
@media (orientation: portrait) {
  #screen-studio {
    grid-template-columns: minmax(0, 1fr);
  }
}
.studio-bar .progress-wrap {
  flex: 1 1 auto;
  min-width: 0;
}
.studio-bar .topbar-actions {
  flex: 0 0 auto;
  margin-left: 0;
}
.toolbar,
.tool-row,
.numbers-legend {
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 480px) {
  .studio-bar { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .studio-bar .icon-btn { width: 38px; height: 38px; min-width: 38px; font-size: 15px; border-radius: 11px; }
  .studio-bar .btn-small { padding: 6px 10px; min-height: 38px; font-size: 13px; }
  .progress-ring { width: 40px; height: 40px; }
  .studio-title span { display: none; }
  .legend-chip { min-width: 50px; padding: 4px 4px 3px; }
  .legend-chip b { width: 30px; height: 30px; font-size: 15px; }
}
@media (max-width: 360px) {
  #btn-clear { display: none; }
}

/* scrolling screens: rows keep their natural height instead of squashing */
.screen:not(#screen-studio) > * {
  flex-shrink: 0;
}

/* ---------- finish screen: stars pop in one by one (each with a ding) ---------- */
.star-pop {
  display: inline-block;
  opacity: 0;
  transform: scale(0.2) rotate(-30deg);
  animation: starPop 0.42s cubic-bezier(0.2, 1.7, 0.4, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes starPop {
  to { opacity: 1; transform: none; }
}
/* audio switches on the home bar */
#btn-music.off,
#btn-sound.off {
  opacity: 0.5;
  filter: grayscale(1);
}
@media (max-width: 420px) {
  .topbar-actions { gap: 6px; }
  #screen-home .icon-btn { width: 42px; height: 42px; min-width: 42px; font-size: 17px; }
}

/* =========================================================
   HOW TO PLAY / HELP
   ========================================================= */
.pill-help {
  background: #fff3b0;
}
.home-actions .pill {
  flex: 1 1 150px;
}

/* ❓ on the picture (top-left of the painting area) */
.studio-main {
  position: relative;
}
.stage-help {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 8;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--ink-line);
  background: #fff3b0;
  color: var(--text);
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 4px 0 var(--ink-line);
  display: grid;
  place-items: center;
}
.stage-help:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink-line);
}
body.band-little .stage-help {
  width: 48px;
  height: 48px;
  font-size: 26px;
}

/* help screen */
.help-wrap {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 4px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.help-card {
  background: #fff;
  border: 3px solid var(--ink-line);
  border-radius: 22px;
  box-shadow: 0 5px 0 var(--ink-line);
  padding: 14px 16px 16px;
}
.help-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.help-card-head h3 {
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.say-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--ink-line);
  background: #e9f6ff;
  box-shadow: 0 3px 0 var(--ink-line);
  font-size: 16px;
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
}
.say-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink-line);
}

.help-hero {
  background: linear-gradient(160deg, #fff7d6, #fff);
}
.help-start {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.help-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  padding: 14px 8px 12px;
  border: 3px solid var(--ink-line);
  border-radius: 18px;
  background: #fff;
}
.help-num {
  position: absolute;
  top: -12px;
  left: -10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ff8fc4;
  border: 2px solid var(--ink-line);
  font-weight: 700;
  font-size: 15px;
}
.help-big {
  font-size: 34px;
  line-height: 1.1;
}
.help-step b {
  font-size: 15px;
}
.help-step small,
.help-item small {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  font-weight: 600;
}

.help-modes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.help-mode {
  border: 3px solid var(--ink-line);
  border-radius: 18px;
  padding: 10px 12px 12px;
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  display: flex;
  flex-direction: column;
}
.help-mode-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.help-mode-head .mode-icon {
  width: 40px;
  height: 40px;
  font-size: 20px;
  border-radius: 12px;
}
.help-mode-head b {
  flex: 1;
  font-size: 16px;
}
.help-steps {
  margin: 8px 0 6px;
  padding-left: 22px;
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 600;
  text-align: left;
}
.help-steps li {
  margin: 2px 0;
}
.help-steps li::marker {
  font-weight: 700;
  color: color-mix(in srgb, var(--accent, #2979ff) 70%, #2a2440);
}
.help-tip {
  margin: auto 0 8px;
  padding: 7px 10px;
  border-radius: 12px;
  background: #fff7d6;
  border: 2px dashed #e0a82e;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
}
.help-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.help-try {
  align-self: flex-start;
}

.help-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.help-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 14px;
  background: #f7f4ff;
}
.help-item > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.help-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 2px solid var(--ink-line);
  font-size: 18px;
  font-weight: 700;
}
.help-item b {
  font-size: 14px;
}

.faq {
  border: 2px solid var(--ink-line);
  border-radius: 14px;
  margin: 8px 0;
  background: #fff;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 11px 14px;
  font-weight: 700;
  font-size: 14.5px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::before {
  content: "＋";
  color: #8f5bff;
  font-weight: 700;
}
.faq[open] summary::before {
  content: "－";
}
.faq[open] summary {
  background: #f3edff;
}
.faq p {
  margin: 0;
  padding: 10px 14px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--text);
}

/* in-picture help card */
.mode-help-icon {
  font-size: 52px;
  line-height: 1;
  margin: 2px 0 4px;
}
.mode-help .help-steps {
  font-size: 15px;
}

/* first-time welcome */
.intro {
  text-align: center;
}
.intro-icon {
  font-size: 72px;
  line-height: 1.1;
  animation: bob 2.4s ease-in-out infinite;
}
.intro-text {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  margin: 4px 0 12px;
}
.intro-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.intro-dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e2dcf0;
  border: 2px solid var(--ink-line);
}
.intro-dots i.on {
  background: #ff8fc4;
}

@media (max-width: 520px) {
  .help-start {
    grid-template-columns: minmax(0, 1fr);
  }
  .help-step {
    flex-direction: row;
    text-align: left;
    gap: 10px;
    padding: 10px 12px 10px 18px;
  }
  .help-step small {
    margin-left: auto;
  }
}

/* =========================================================
   SKETCHBOOK — the final art direction (overrides everything above)
   Warm dotted paper, ink lines like the coloring pages, five crayon
   colors, drawn icons, polaroid pictures. No gradients, no glows.
   ========================================================= */
:root {
  --paper: #f6efe2;
  --paper-hi: #fffcf4;
  --paper-lo: #ece3d1;
  --ink: #2b2438;
  --ink-soft: #6b6280;
  --tomato: #f0553f;
  --sun: #f5b82e;
  --leaf: #3fae6a;
  --sky: #3d8bea;
  --plum: #8e5cd9;
  --ink-line: var(--ink);
  --text: var(--ink);
  --muted: var(--ink-soft);
  --ring: var(--leaf);
  --ring-empty: #e6dccb;
  --print: 3px 3px 0 var(--ink);
  --print-lg: 5px 5px 0 var(--ink);
}

body {
  color: var(--ink);
  background: radial-gradient(rgba(43, 36, 56, 0.14) 1.1px, transparent 1.3px) 0 0 / 22px 22px, var(--paper);
  background-attachment: fixed;
}

/* drawn icons */
.ic {
  width: 1.3em;
  height: 1.3em;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: -0.28em;
  overflow: visible;
}
[data-ic] {
  display: inline-flex;
}

/* ---------- splash ---------- */
#splash {
  background: radial-gradient(rgba(43, 36, 56, 0.14) 1.1px, transparent 1.3px) 0 0 / 22px 22px, var(--paper);
  gap: 6px;
}
.splash-logo .ic {
  width: 84px;
  height: 84px;
  animation: bob 1.8s ease-in-out infinite;
}
#splash p {
  color: var(--ink-soft);
  font-family: var(--display);
  font-weight: 500;
  margin-top: 8px;
}
.scribble {
  width: 220px;
  height: 18px;
  margin-top: -6px;
}
.scribble path {
  fill: none;
  stroke: var(--tomato);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: scribble 1.2s ease forwards 0.2s;
}
@keyframes scribble {
  to { stroke-dashoffset: 0; }
}

/* ---------- wordmark ---------- */
.wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.2px;
  color: var(--ink);
}
.wordmark em {
  font-style: normal;
  color: var(--tomato);
}
.wordmark.big {
  font-size: clamp(44px, 10vw, 64px);
}
.logo-mark .ic {
  width: 34px;
  height: 34px;
}

/* ---------- shared surfaces: printed-sticker look ---------- */
.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: 2px solid var(--ink);
  box-shadow: var(--print);
}
.icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  position: relative;
}
.icon-btn .ic {
  width: 24px;
  height: 24px;
}
.icon-btn:hover,
.link-tile:hover,
.mode-tile:hover,
.chip:hover,
.tab:hover {
  background: #fff;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.icon-btn:active,
.btn:active,
.chip:active,
.tab:active,
.link-tile:active,
.mode-tile:active,
.art-card:active,
.gallery-card:active,
.legend-chip:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
/* a switched-off audio button gets a hand-drawn slash */
.icon-btn.off {
  opacity: 1;
  filter: none;
  color: var(--ink-soft);
  background: var(--paper-lo);
}
.icon-btn.off .ic {
  opacity: 0.55;
}
.icon-btn.off::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  top: 50%;
  height: 3px;
  border-radius: 3px;
  background: var(--tomato);
  transform: rotate(-38deg);
}

/* ---------- buttons ---------- */
.btn {
  border-radius: 12px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.2px;
  gap: 8px;
  min-height: 46px;
}
.btn .ic {
  width: 20px;
  height: 20px;
}
.btn-p1 { background: #b8d4f7; }
.btn-p2 { background: #9bdcb2; }
.btn-p3 { background: #f8b4cb; }
.btn-p4 { background: var(--sun); }
.btn-ghost { background: var(--paper-hi); }
.btn-big {
  background: var(--sun);
  font-size: 17px;
  min-height: 54px;
  padding: 12px 22px;
}
.btn-small {
  min-height: 40px;
  border-radius: 11px;
  box-shadow: var(--print);
}
#btn-done.ready {
  animation: none;
  background: var(--sun);
}
#btn-done.ready .ic {
  animation: tick 1.2s ease-in-out infinite;
}
@keyframes tick {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3) rotate(-8deg); }
}
.text-link {
  border: 0;
  background: none;
  padding: 6px 2px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--tomato);
  text-underline-offset: 5px;
}

/* ---------- home ---------- */
.home-top {
  max-width: 1040px;
}
.home {
  max-width: 1040px;
  padding: 4px 18px 40px;
}
.hero-pick {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 32px;
  padding: 14px 8px 30px;
}
.hero-thumb {
  position: relative;
  padding: 12px 12px 34px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--print-lg);
  transform: rotate(-2.2deg);
  transition: transform 0.2s ease;
  justify-self: center;
  width: min(100%, 380px);
}
.hero-thumb:hover {
  transform: rotate(-0.6deg) translateY(-3px);
}
.hero-thumb::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 50%;
  width: 96px;
  height: 26px;
  margin-left: -48px;
  background: rgba(245, 184, 46, 0.6);
  border-left: 2px dashed rgba(43, 36, 56, 0.18);
  border-right: 2px dashed rgba(43, 36, 56, 0.18);
  transform: rotate(3deg);
}
.hero-thumb img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 2px;
  border: 1px solid rgba(43, 36, 56, 0.15);
}
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.kicker {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  color: var(--tomato);
  letter-spacing: 0.3px;
}
.hero-copy h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(38px, 6.4vw, 60px);
  line-height: 1;
  color: var(--ink);
  text-shadow: none;
  margin: 0;
}
.hero-line {
  margin: 4px 0 14px;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink-soft);
  max-width: 32ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4px;
}

.home-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 6px 0 12px;
  padding-top: 18px;
  border-top: 2px dashed rgba(43, 36, 56, 0.22);
}
.section-label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
  margin: 0;
}
.level {
  display: flex;
  align-items: center;
  gap: 10px;
}
.level-label {
  font-family: var(--display);
  font-size: 14px;
  color: var(--ink-soft);
}
.band-row {
  display: inline-flex;
  grid-template-columns: none;
  gap: 0;
  padding: 3px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-hi);
  box-shadow: var(--print);
}
.seg {
  border: 0;
  background: transparent;
  padding: 7px 16px;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
  min-height: 36px;
}
.seg.active {
  background: var(--ink);
  color: var(--paper-hi);
}
body.band-little .seg {
  padding: 9px 18px;
  font-size: 16px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin: 0;
}
.mode-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 12px 14px;
  border-radius: 14px;
  text-align: left;
  font-family: var(--display);
  transition: transform 0.1s, box-shadow 0.1s;
}
.mode-badge {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  background: color-mix(in srgb, var(--accent) 22%, var(--paper-hi));
  border: 2px solid var(--ink);
}
.mode-badge .ic {
  width: 28px;
  height: 28px;
}
.mode-tile b {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.15;
}
.mode-tile small {
  font-family: var(--body);
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--ink-soft);
  font-weight: 500;
}
body.band-little .mode-tile b {
  font-size: 18px;
}

.home-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.link-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  font-family: var(--display);
  font-size: 16px;
  min-height: 56px;
  transition: transform 0.1s, box-shadow 0.1s;
}
.link-tile .ic {
  width: 28px;
  height: 28px;
}
.link-tile b {
  font-weight: 600;
}
.link-tile i {
  margin-left: auto;
  font-style: normal;
  font-weight: 600;
  font-size: 13px;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--paper-lo);
  border: 2px solid var(--ink);
}
.home-stats {
  display: block;
  margin: 18px 0 0;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}
.home-stats .ic {
  width: 18px;
  height: 18px;
  margin-right: 3px;
}
.home-stats b {
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
}
.home-stats i {
  font-style: normal;
  margin: 0 4px;
  opacity: 0.5;
}

/* ---------- topbars ---------- */
.topbar-title h2 {
  font-weight: 700;
  font-size: 26px;
}
.topbar-title p {
  color: var(--ink-soft);
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: 0.2px;
  text-transform: none;
  font-size: 14px;
}

/* ---------- picture picker: polaroids on the page ---------- */
.tab {
  gap: 8px;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-soft);
  padding: 8px 16px 8px 12px;
}
.tab .ic {
  width: 22px;
  height: 22px;
}
.tab.active {
  background: var(--ink);
  color: var(--paper-hi);
  box-shadow: var(--print);
}
.tab.active .ic {
  color: var(--paper-hi);
}
.art-grid {
  gap: 26px 22px;
  padding: 18px 22px 48px;
}
.art-card {
  --tilt: -1.2deg;
  position: relative;
  padding: 10px 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: #fff;
  box-shadow: var(--print);
  transform: rotate(var(--tilt));
  transition: transform 0.15s, box-shadow 0.15s;
  gap: 8px;
}
.art-card:nth-child(2n) { --tilt: 1.1deg; }
.art-card:nth-child(3n) { --tilt: -0.5deg; }
.art-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: -11px;
  left: 50%;
  width: 70px;
  height: 22px;
  margin-left: -35px;
  background: rgba(61, 139, 234, 0.35);
  transform: rotate(-4deg);
}
.art-card:nth-child(2n)::before { background: rgba(240, 85, 63, 0.32); transform: rotate(3deg); }
.art-card:nth-child(3n)::before { background: rgba(245, 184, 46, 0.5); }
.art-card:hover {
  border-color: var(--ink);
  transform: rotate(0deg) translateY(-3px);
  box-shadow: 5px 5px 0 var(--ink);
}
.art-thumb {
  border: 1px solid rgba(43, 36, 56, 0.15);
  border-radius: 2px;
}
.art-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  padding: 0;
}
.art-badge {
  top: auto;
  bottom: 6px;
  right: 6px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--paper-hi);
  border: 2px solid var(--ink);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.2px;
}
.mini-stars {
  display: inline-flex;
  gap: 1px;
}
.mini-stars .ic {
  width: 16px;
  height: 16px;
}
.ic.off {
  --ic: #e9e1d2;
  color: #b9afc9;
}
.art-card.locked {
  background: var(--paper-lo);
}
.art-card.locked .art-thumb img {
  filter: grayscale(1);
  opacity: 0.35;
}
.lock-veil .ic {
  width: 46px;
  height: 46px;
}

/* ---------- studio ---------- */
.studio-title span {
  color: var(--ink-soft);
  font-family: var(--display);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.2px;
  font-size: 13px;
}
.studio-title b {
  font-weight: 700;
  font-size: 18px;
}
.progress-ring {
  border: 2px solid var(--ink);
  box-shadow: none;
}
.progress-ring::before {
  background: var(--paper-hi);
}
.progress-ring span {
  font-family: var(--display);
  font-weight: 600;
}
.progress-ring.full {
  box-shadow: none;
}
.stage {
  border-radius: 10px;
  box-shadow: 0 0 0 2.5px var(--ink), 6px 6px 0 2.5px var(--ink);
}
.stage::after {
  opacity: 0;
}
.toolbar {
  background: var(--paper-hi);
  border-top: 2px solid var(--ink);
  backdrop-filter: none;
}
@media (min-width: 900px) and (orientation: landscape) {
  #screen-studio .toolbar {
    border-left: 2px solid var(--ink);
  }
  .stage {
    box-shadow: 0 0 0 2.5px var(--ink), 7px 7px 0 2.5px var(--ink);
  }
}
.stage-help {
  width: 42px;
  height: 42px;
  border: 2px solid var(--ink);
  background: var(--paper-hi);
  box-shadow: var(--print);
}
.stage-help .ic {
  width: 26px;
  height: 26px;
}
.swatch {
  border-radius: 50%;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.swatch.active {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 0 0 3px var(--paper-hi), 0 0 0 5px var(--ink);
}
.chip {
  border-radius: 11px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 14px;
  gap: 6px;
}
.chip .ic {
  width: 22px;
  height: 22px;
}
.chip.active,
.chip.tool.active {
  background: var(--ink);
  color: var(--paper-hi);
}
.chip.active .ic {
  color: var(--paper-hi);
}
.legend-chip {
  border-radius: 12px;
  font-family: var(--display);
}
.legend-chip b {
  border: 2px solid var(--ink);
  font-weight: 600;
}
.legend-chip small {
  font-family: var(--display);
  font-weight: 500;
}
.legend-chip.active {
  box-shadow: 0 0 0 3px var(--paper-hi), 0 0 0 5px var(--ink);
}
.legend-chip.done::after {
  background: var(--leaf);
}
.trace-banner span .ic {
  width: 36px;
  height: 36px;
}
.trace-banner b {
  font-family: var(--display);
  font-weight: 600;
}
.hint,
#toast {
  border-radius: 12px;
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--display);
  font-weight: 500;
  font-size: 15px;
}
.word-pop {
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--paper-hi);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--display);
  font-weight: 600;
}
.word-pop.new {
  background: #ffe7a3;
}
.num-badge {
  border: 2px solid var(--ink);
  font-family: var(--display);
  font-weight: 600;
}

/* ---------- modals ---------- */
.modal-back {
  background: rgba(43, 36, 56, 0.42);
  backdrop-filter: none;
}
.modal-card {
  border-radius: 16px;
  box-shadow: var(--print-lg);
  background: var(--paper-hi);
}
.modal-title {
  font-weight: 700;
  font-size: 28px;
}
.modal-sub {
  font-family: var(--display);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.2px;
  font-size: 14px;
  color: var(--ink-soft);
}
.complete-img {
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 8px 8px 24px;
  background: #fff;
  box-shadow: var(--print);
  transform: rotate(-1.5deg);
}
.stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 10px 0;
}
.stars .ic {
  width: 44px;
  height: 44px;
}
.complete-unlock {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: #dff3e6;
  font-weight: 500;
}
.complete-unlock .ic {
  width: 28px;
  height: 28px;
}
.complete-gift {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
}
.fact {
  border: 2px dashed var(--plum);
  border-radius: 12px;
  background: #f1eafd;
  font-weight: 500;
}
.fact b {
  font-family: var(--display);
  text-transform: none;
  letter-spacing: 0.2px;
  font-size: 14px;
  font-weight: 600;
}
.gift-box .ic {
  width: 120px;
  height: 120px;
}
.gift-tap {
  font-family: var(--display);
  text-transform: none;
  letter-spacing: 0.2px;
  font-size: 15px;
}

/* ---------- help ---------- */
.help-card {
  border-radius: 16px;
}
.help-card-head h3 {
  font-weight: 700;
}
.help-hero {
  background: var(--paper-hi);
}
.say-btn {
  background: var(--paper-hi);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.say-btn .ic {
  width: 20px;
  height: 20px;
}
.help-step,
.help-mode,
.faq {
  border: 2px solid var(--ink);
}
.help-num {
  background: var(--sun);
  border: 2px solid var(--ink);
  font-family: var(--display);
}
.help-big .ic {
  width: 40px;
  height: 40px;
}
.help-mode {
  background: color-mix(in srgb, var(--accent) 9%, var(--paper-hi));
}
.help-mode-head .mode-badge {
  width: 40px;
  height: 40px;
  margin: 0;
}
.help-mode-head .mode-badge .ic {
  width: 24px;
  height: 24px;
}
.help-tip {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: #fff3cf;
  border: 2px dashed var(--sun);
}
.help-tip .ic {
  width: 20px;
  height: 20px;
}
.help-item {
  background: var(--paper);
  border-radius: 12px;
}
.help-icon {
  background: var(--paper-hi);
  border: 2px solid var(--ink);
}
.help-icon .ic {
  width: 22px;
  height: 22px;
}
.faq[open] summary {
  background: var(--paper);
}
.faq summary::before {
  color: var(--tomato);
}
.mode-help-icon .ic,
.intro-icon .ic {
  width: 72px;
  height: 72px;
}

/* gallery & treasures */
.gallery-card {
  border-radius: 5px;
  background: #fff;
}
.box-banner {
  border-radius: 16px;
}
.boxes-count {
  color: var(--tomato);
  -webkit-text-stroke: 0;
  text-shadow: none;
}

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .hero-pick {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 8px 4px 22px;
    text-align: center;
  }
  .hero-thumb {
    width: min(78%, 320px);
  }
  .hero-copy {
    align-items: center;
  }
  .hero-actions {
    justify-content: center;
  }
  .home-links {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
}
@media (max-width: 520px) {
  .wordmark { font-size: 20px; }
  .logo-mark .ic { width: 28px; height: 28px; }
  .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mode-tile small { display: none; }
  .art-grid { gap: 22px 16px; padding: 16px 16px 40px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .hero-pick { grid-template-columns: 200px minmax(0, 1fr); padding: 4px 4px 14px; gap: 20px; }
  .hero-copy h1 { font-size: 34px; }
}

/* picker: more polaroids per row on wide screens */
.art-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  max-width: 1100px;
}
@media (max-width: 520px) {
  .art-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- gallery: a wall of polaroids ---------- */
.gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 26px 22px;
  padding: 18px 22px 48px;
  max-width: 1100px;
}
.gallery-card {
  --tilt: 1.2deg;
  position: relative;
  padding: 9px 9px 10px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  box-shadow: var(--print);
  transform: rotate(var(--tilt));
  transition: transform 0.15s, box-shadow 0.15s;
}
.gallery-card:nth-child(2n) { --tilt: -1.4deg; }
.gallery-card:nth-child(3n) { --tilt: 0.4deg; }
.gallery-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: -11px;
  left: 50%;
  width: 64px;
  height: 22px;
  margin-left: -32px;
  background: rgba(63, 174, 106, 0.32);
  transform: rotate(-3deg);
}
.gallery-card:nth-child(2n)::before { background: rgba(142, 92, 217, 0.28); transform: rotate(4deg); }
.gallery-card:hover {
  transform: rotate(0) translateY(-3px);
  box-shadow: 5px 5px 0 var(--ink);
}
.gallery-card img {
  border-radius: 2px;
  border: 1px solid rgba(43, 36, 56, 0.12);
}
.gallery-meta {
  align-items: center;
  text-align: center;
  padding: 8px 2px 0;
}
.gallery-meta b {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
}
.gallery-meta small {
  font-family: var(--display);
  font-weight: 500;
  color: var(--ink-soft);
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  margin: 40px auto;
  padding: 0 24px;
  max-width: 420px;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: 17px;
}
.empty-state img {
  width: 180px;
  height: auto;
}

/* ---------- treasures: gift banner + sticker album ---------- */
.box-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  max-width: 900px;
  margin: 6px auto 20px;
  width: calc(100% - 32px);
  background: var(--paper-hi);
}
.box-art .ic,
.box-art img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}
.box-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.box-copy b {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
}
.box-copy small {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
}
.treasure-grid {
  display: block;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 48px;
}
.album-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 2px 12px;
  font-family: var(--display);
}
.album-head b {
  font-size: 21px;
  font-weight: 700;
}
.album-head span {
  color: var(--ink-soft);
  font-weight: 500;
}
.album {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 14px;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background:
    linear-gradient(rgba(43, 36, 56, 0.06) 1px, transparent 1px) 0 0 / 100% 28px,
    var(--paper-hi);
  box-shadow: var(--print);
}
.slot {
  position: relative;
  aspect-ratio: 1 / 1.12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 14px;
  text-align: center;
  font-family: var(--display);
}
.slot.found {
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-1.5deg);
}
.slot.found:nth-child(2n) { transform: rotate(1.4deg); }
.slot.found.rare { background: #eef5ff; }
.slot.found.epic { background: #fff3d6; }
.slot.found b {
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.15;
}
.slot.found i {
  position: absolute;
  top: -8px;
  right: -8px;
  font-style: normal;
  font-weight: 600;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--sun);
  border: 2px solid var(--ink);
}
.slot.empty {
  border: 2px dashed rgba(43, 36, 56, 0.3);
  color: rgba(43, 36, 56, 0.35);
}
.slot-q {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}
.slot.empty small {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.treasure-img {
  width: 72%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(2px 2px 0 rgba(43, 36, 56, 0.25));
}
.slot .treasure-emoji {
  font-size: 44px;
  filter: none;
}
.gift-emoji .treasure-img.big {
  width: 150px;
}
.gift-emoji .treasure-emoji.big {
  font-size: 84px;
}
@media (max-width: 520px) {
  .box-banner {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .box-banner .btn {
    grid-column: 1 / -1;
  }
  .album {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
  }
  .slot.found b {
    font-size: 12px;
  }
}

.sticker-btn img { width: 34px; height: 34px; object-fit: contain; }
.sticker-more { font-family: var(--display); font-size: 12.5px; color: var(--ink-soft); align-self: center; padding: 0 6px; }

/* =========================================================
   ILLUSTRATIONS — Pip the mascot, gift box, crayons, paper
   ========================================================= */
body,
#splash {
  background:
    radial-gradient(rgba(43, 36, 56, 0.12) 1.1px, transparent 1.3px) 0 0 / 22px 22px,
    url("../assets/ui/paper.jpg") 0 0 / 420px 420px,
    var(--paper);
}
.pip {
  display: block;
  height: auto;
  pointer-events: none;
  user-select: none;
}
.splash-pip {
  width: 150px;
  height: auto;
  animation: bob 1.8s ease-in-out infinite;
}
.intro-icon .pip-intro {
  width: 170px;
  margin: -6px auto 2px;
}
.help-card-head .pip-help {
  width: 64px;
  margin: -14px 0 -8px -6px;
}
.empty-state .pip,
#gallery-empty .pip {
  width: 170px;
  margin: 0 auto 6px;
}
#gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-family: var(--display);
  font-size: 17px;
}
#gallery-empty[hidden] {
  display: none;
}
.complete-top {
  position: relative;
  display: flex;
  justify-content: center;
}
.pip-cheer {
  position: absolute;
  right: -6px;
  bottom: -18px;
  width: 110px;
  transform: rotate(6deg);
  animation: pipHop 1.4s ease-in-out infinite;
}
@keyframes pipHop {
  0%, 100% { transform: rotate(6deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-8px); }
}
.hero-thumb {
  overflow: visible;
}
.hero-crayons {
  position: absolute;
  left: -42px;
  bottom: -30px;
  width: 150px !important;
  border: 0 !important;
  aspect-ratio: auto !important;
  transform: rotate(-8deg);
  pointer-events: none;
}
.gift-box img {
  width: 150px;
  height: auto;
  filter: drop-shadow(3px 4px 0 rgba(43, 36, 56, 0.18));
}
.gift-emoji {
  position: relative;
  display: grid;
  place-items: center;
}
.gift-emoji .gift-burst {
  position: absolute;
  width: 190px;
  opacity: 0.35;
  z-index: 0;
}
.gift-emoji .treasure-img,
.gift-emoji .treasure-emoji {
  position: relative;
  z-index: 1;
}
.box-art img {
  width: 84px;
  height: 84px;
  object-fit: contain;
}
@media (max-width: 720px) {
  .hero-crayons {
    width: 110px !important;
    left: -26px;
    bottom: -22px;
  }
  .pip-cheer {
    width: 86px;
  }
}

/* =========================================================
   ONE-PAGE NAVIGATION — splash (studio → game), one home page
   (how to paint + pictures), slide-up sheets for the rest.
   ========================================================= */

/* ---------- splash: studio logo first, then the game ---------- */
.splash-studio {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: #080a1b; /* matches assets/ui/studio-logo.jpg */
  animation: studioOut 0.45s ease 1.3s forwards;
}
.splash-studio img {
  width: min(64vmin, 340px);
  height: auto;
  animation: studioIn 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes studioIn {
  from { opacity: 0; transform: scale(0.9); }
}
@keyframes studioOut {
  to { opacity: 0; visibility: hidden; }
}
#splash.skip .splash-studio {
  animation: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
}
#splash .splash-pip {
  animation: titleIn 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) 1.45s both, bob 1.8s ease-in-out 2s infinite;
}
#splash .wordmark,
#splash .scribble,
#splash > p {
  animation: titleIn 0.45s ease 1.6s both;
}
#splash.skip .splash-pip,
#splash.skip .wordmark,
#splash.skip .scribble,
#splash.skip > p {
  animation-delay: 0s;
}
@keyframes titleIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
}

/* ---------- home ---------- */
#screen-home .home {
  padding-bottom: 12px;
}
.mode-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding: 6px 4px 10px;
  margin: 0 -4px;
  scrollbar-width: none;
}
.mode-strip::-webkit-scrollbar {
  display: none;
}
.mode-chip {
  flex: 1 0 96px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px 9px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--paper-hi);
  box-shadow: var(--print);
  font-family: var(--display);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.mode-chip .mode-badge {
  width: 56px;
  height: 56px;
  margin: 0;
}
.mode-chip .mode-badge .ic {
  width: 32px;
  height: 32px;
}
.mode-chip .mode-badge .ic-img {
  width: 52px;
  height: 52px;
}
.mode-chip b {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.1;
  text-align: center;
}
.mode-chip:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
.mode-chip.active {
  background: color-mix(in srgb, var(--accent) 30%, var(--paper-hi));
  box-shadow: var(--print-lg);
  transform: translateY(-2px);
}
.mode-chip.active .mode-badge {
  background: var(--paper-hi);
}
.mode-line {
  margin: 0 0 4px;
  text-align: center;
  font-family: var(--display);
  font-size: 15px;
  color: var(--ink-soft);
}
#screen-home .home-row {
  margin: 4px 0 2px;
  padding-top: 12px;
}
#screen-home .tabs {
  padding: 4px 2px;
  margin: 0;
  flex: 1 1 auto;
  max-width: 100%;
}
#screen-home .art-grid {
  padding: 22px 6px 24px;
  max-width: none;
}
.next-flag {
  position: absolute;
  z-index: 3;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 6px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--sun);
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  pointer-events: none;
}
.next-flag .ic {
  width: 16px;
  height: 16px;
}

/* ---------- bottom dock: help, pictures, stickers ---------- */
.dock {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: auto;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: radial-gradient(rgba(43, 36, 56, 0.12) 1.1px, transparent 1.3px) 0 0 / 22px 22px, var(--paper);
  border-top: 2px solid var(--ink);
}
.dock-btn {
  flex: 1 1 0;
  max-width: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper-hi);
  box-shadow: var(--print);
  font-family: var(--display);
  font-size: 15px;
  color: var(--ink);
  transition: transform 0.1s, box-shadow 0.1s;
}
.dock-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
.dock-btn .ic {
  width: 30px;
  height: 30px;
}
.dock-btn .ic-img {
  width: 38px;
  height: 38px;
  margin: -6px 0;
}
.dock-btn b {
  font-weight: 600;
  white-space: nowrap;
}
.dock-btn i {
  font-style: normal;
  font-weight: 600;
  font-size: 13px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--paper-lo);
  border: 2px solid var(--ink);
}
@media (max-width: 520px) {
  .dock-btn {
    flex-direction: column;
    gap: 2px;
    min-height: 62px;
    font-size: 13px;
    position: relative;
  }
  .dock-btn i {
    position: absolute;
    top: -9px;
    right: -6px;
  }
  .mode-chip {
    flex-basis: 86px;
  }
}

/* ---------- sheets: slide up over the page ---------- */
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: max(6vh, calc(10px + env(safe-area-inset-top)));
  z-index: 30;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom);
  background: radial-gradient(rgba(43, 36, 56, 0.12) 1.1px, transparent 1.3px) 0 0 / 22px 22px, var(--paper);
  border: 2px solid var(--ink);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -5px 0 rgba(43, 36, 56, 0.14);
  transform: translateY(105%);
  visibility: hidden;
  transition: transform 0.34s cubic-bezier(0.2, 0.85, 0.25, 1), visibility 0.34s;
}
.sheet.open {
  transform: none;
  visibility: visible;
}
.sheet > * {
  flex-shrink: 0;
}
.sheet::before {
  content: "";
  display: block;
  width: 56px;
  height: 5px;
  border-radius: 99px;
  background: rgba(43, 36, 56, 0.25);
  margin: 8px auto -4px;
}
.sheet .topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: 10px;
  background: inherit;
}
.sheet .topbar-title {
  flex: 1 1 auto;
}
.sheet .spacer {
  display: none;
}
.sheet .sheet-close {
  order: 3;
}
#sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(43, 36, 56, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
body[data-sheet] #sheet-scrim {
  opacity: 1;
  pointer-events: auto;
}

/* illustrated PNG icons */
.ic-img {
  object-fit: contain;
  vertical-align: middle;
  user-select: none;
  -webkit-user-drag: none;
}
.ic-img.off {
  filter: grayscale(1);
  opacity: 0.35;
}
#screen-home .home-row .tabs {
  flex: 0 1 auto;
}
