:root {
  color-scheme: light;
  --ink: #2d504d;
  --muted: #69817c;
  --paper: #fffdf7;
  --cream: #fff6dc;
  --line: #dfd2b2;
  --green: #3e9875;
  --green-dark: #28745a;
  --coral: #ef7468;
  --yellow: #f5c84c;
  --blue: #5aadd5;
  --purple: #8872b4;
  --shadow: 0 18px 45px rgba(67, 78, 61, .13);
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 0; scroll-behavior: smooth; }

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 7%, rgba(245, 200, 76, .22) 0 84px, transparent 85px),
    radial-gradient(circle at 94% 28%, rgba(90, 173, 213, .14) 0 135px, transparent 136px),
    radial-gradient(circle, rgba(68, 112, 98, .1) 1.2px, transparent 1.3px) 0 0 / 24px 24px,
    linear-gradient(135deg, #fffaf0, #f5fbf4 55%, #fff6e3);
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, [tabindex]:focus-visible { outline: 4px solid rgba(90, 173, 213, .42); outline-offset: 3px; }
button:disabled { cursor: default; opacity: .42; transform: none !important; }

.app {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 58px;
}

.loading-card {
  display: grid;
  min-height: 360px;
  place-content: center;
  gap: 14px;
  border: 2px solid var(--line);
  border-radius: 38px;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
}

.loading-card span { font-size: 68px; animation: float 1.8s ease-in-out infinite; }
.loading-card p { margin: 0; color: var(--muted); font-weight: 900; }

.game-topbar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand-button, .soft-button, .back-button, .text-button, .secondary-button, .primary-button,
.canvas-actions button, .tool-tabs button, .pattern-grid button, .size-grid button, .save-button,
.collection-card, .picture-card, .collection-tabs button, .danger-button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: transparent;
  text-align: left;
}

.brand-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 2px solid #e2c984;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffe283, #f7be48);
  box-shadow: 0 6px 0 #d9b55b, 0 10px 22px rgba(100, 73, 25, .13);
  font-size: 29px;
  transition: .16s transform;
}

.brand-button:hover .brand-icon { transform: rotate(-4deg) translateY(-2px); }
.brand-button strong, .brand-button small { display: block; }
.brand-button strong { font-size: 20px; line-height: 1.1; }
.brand-button small { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }

.top-actions { display: flex; align-items: center; gap: 10px; }

.soft-button {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border: 2px solid #d9ceb4;
  border-radius: 17px;
  background: rgba(255, 253, 247, .92);
  box-shadow: 0 5px 0 rgba(203, 188, 150, .5);
  transition: .15s transform, .15s box-shadow;
}

.soft-button:hover { transform: translateY(-2px); box-shadow: 0 7px 0 rgba(203, 188, 150, .5); }
.soft-button:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(203, 188, 150, .5); }
.soft-button > span { font-size: 20px; }
.soft-button b { font-size: 13px; }
.soft-button small { display: inline-grid; min-width: 47px; height: 25px; place-items: center; border-radius: 10px; background: #eaf5ee; color: var(--green-dark); font-size: 10px; font-weight: 900; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .13em;
}

.hero-card {
  position: relative;
  display: grid;
  min-height: 493px;
  grid-template-columns: 1.03fr .97fr;
  overflow: hidden;
  border: 2px solid #ddcda7;
  border-radius: 42px;
  background: linear-gradient(112deg, #fffdf4 0 54%, #e1f4e6 54% 100%);
  box-shadow: 0 14px 0 rgba(208, 188, 142, .46), var(--shadow);
}

.hero-card::before {
  position: absolute;
  width: 190px;
  height: 52px;
  top: -19px;
  left: calc(50% - 95px);
  border: 1px solid rgba(190, 156, 91, .38);
  background: rgba(250, 224, 150, .52);
  box-shadow: 0 4px 8px rgba(108, 77, 33, .1);
  content: "";
  transform: rotate(-1.5deg);
  z-index: 4;
}

.hero-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 66px 30px 58px 64px;
  z-index: 3;
}

.hero-copy h1, .library-hero h1, .album-hero h1, .result-copy h1 {
  margin: 0;
  font-size: clamp(45px, 5.4vw, 68px);
  line-height: .96;
  letter-spacing: -.055em;
}

.hero-copy h1 span { color: var(--coral); }
.hero-copy > p:not(.eyebrow) { max-width: 550px; margin: 24px 0 0; color: var(--muted); font-size: 18px; font-weight: 700; line-height: 1.55; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-top: 30px; }

.primary-button {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 24px;
  border-radius: 17px;
  background: linear-gradient(180deg, #ef7e6d, #e96958);
  box-shadow: 0 7px 0 #bf5044, 0 13px 25px rgba(202, 77, 60, .22);
  color: white;
  font-size: 16px;
  font-weight: 900;
  transition: .16s transform, .16s box-shadow;
}

.primary-button:hover { transform: translateY(-3px); box-shadow: 0 10px 0 #bf5044, 0 16px 28px rgba(202, 77, 60, .24); }
.primary-button:active { transform: translateY(4px); box-shadow: 0 3px 0 #bf5044; }
.primary-button span { font-size: 24px; }

.text-button {
  min-height: 44px;
  padding: 4px 2px;
  border-bottom: 2px dotted #b68672;
  background: transparent;
  color: #8c5d4a;
  font-weight: 900;
}

.text-button:hover { color: var(--coral); }
.hero-stat { display: flex; align-items: center; gap: 10px; margin-top: 26px; color: var(--muted); }
.hero-stat strong { display: grid; width: 48px; height: 48px; place-items: center; border: 2px solid #b9ddc7; border-radius: 16px; background: #eef9f0; color: var(--green-dark); font-size: 21px; }
.hero-stat span { max-width: 118px; font-size: 12px; font-weight: 900; line-height: 1.25; }

.hero-art { position: relative; min-width: 0; }
.hero-sun { position: absolute; width: 230px; height: 230px; top: -58px; right: -68px; border-radius: 50%; background: rgba(245, 200, 76, .26); }
.hero-splash { position: absolute; border-radius: 52% 48% 44% 56%; filter: drop-shadow(0 8px 12px rgba(44, 93, 74, .1)); }
.splash-one { width: 170px; height: 105px; right: -33px; bottom: 14px; background: rgba(90, 173, 213, .35); transform: rotate(-18deg); }
.splash-two { width: 110px; height: 92px; left: 13px; top: 35px; background: rgba(239, 116, 104, .24); transform: rotate(27deg); }
.hero-paper { position: absolute; width: 370px; max-width: 83%; left: 47%; top: 52%; padding: 14px; border: 2px solid #e5d5b4; border-radius: 28px; background: #fffdf7; box-shadow: 0 18px 30px rgba(55, 72, 60, .19); transform: translate(-50%, -50%) rotate(3deg); }
.hero-paper::before { position: absolute; width: 106px; height: 26px; top: -13px; left: calc(50% - 53px); border: 1px solid #d7c28d; background: rgba(248, 218, 131, .68); content: ""; transform: rotate(-3deg); z-index: 3; }
.hero-paper .coloring-svg { display: block; width: 100%; }
.hero-brush, .hero-pencil { position: absolute; filter: drop-shadow(0 9px 9px rgba(66, 66, 45, .18)); z-index: 3; }
.hero-brush { right: 7%; bottom: 10%; font-size: 72px; transform: rotate(-26deg); }
.hero-pencil { left: 4%; bottom: 8%; font-size: 60px; transform: rotate(22deg); }
.hero-star { position: absolute; top: 17%; right: 11%; color: var(--yellow); font-size: 48px; animation: twinkle 2.3s ease-in-out infinite; }

.how-section, .collections-section { margin-top: 60px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: clamp(31px, 4vw, 46px); line-height: 1; letter-spacing: -.04em; }
.section-heading > p { max-width: 420px; margin: 0; color: var(--muted); font-weight: 700; line-height: 1.45; text-align: right; }

.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.steps-grid article { position: relative; display: grid; min-height: 173px; grid-template-columns: auto 1fr; align-items: center; gap: 17px; padding: 24px 20px; border: 2px solid var(--line); border-radius: 27px; background: rgba(255, 253, 247, .9); box-shadow: 0 8px 0 rgba(218, 203, 168, .52), 0 16px 24px rgba(69, 75, 55, .08); }
.steps-grid article > span { position: absolute; display: grid; width: 40px; height: 40px; top: -13px; left: 18px; place-items: center; border: 3px solid #fffdf7; border-radius: 50%; background: var(--coral); color: white; font: 900 20px Georgia, serif; }
.steps-grid article:nth-child(2) > span { background: var(--yellow); color: #655021; }
.steps-grid article:nth-child(3) > span { background: var(--blue); }
.steps-grid article > i { display: grid; width: 74px; height: 74px; place-items: center; border-radius: 24px; background: #f1f7e7; font-size: 37px; font-style: normal; }
.steps-grid h3 { margin: 0 0 7px; font-size: 19px; }
.steps-grid p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 700; line-height: 1.42; }

.collection-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.collection-card { position: relative; display: grid; min-height: 204px; grid-template-columns: 65px 1fr; align-items: start; gap: 15px; padding: 24px 20px 20px; border: 2px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 28px; background: color-mix(in srgb, var(--accent) 10%, #fffdf7); box-shadow: 0 8px 0 color-mix(in srgb, var(--accent) 22%, #d7c8a8), 0 16px 25px rgba(57, 75, 62, .09); text-align: left; transition: .16s transform, .16s box-shadow; }
.collection-card:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 12px 0 color-mix(in srgb, var(--accent) 22%, #d7c8a8), 0 21px 29px rgba(57, 75, 62, .12); }
.collection-icon { display: grid; width: 65px; height: 65px; place-items: center; border: 2px solid color-mix(in srgb, var(--accent) 34%, white); border-radius: 22px; background: color-mix(in srgb, var(--accent) 19%, white); font-size: 33px; }
.collection-card span > small, .picture-card-info small { color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.collection-card span > strong { display: block; margin-top: 5px; font-size: 20px; }
.collection-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.38; }
.collection-card > b { position: absolute; right: 18px; bottom: 16px; display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 18px; }
.collection-card > b small { color: var(--muted); font-size: 9px; text-transform: uppercase; }

.grownup-note { display: flex; align-items: center; gap: 18px; margin-top: 48px; padding: 23px 28px; border: 2px dashed #d5c59f; border-radius: 24px; background: rgba(255, 249, 230, .84); }
.grownup-note > span { font-size: 38px; }
.grownup-note strong { display: block; margin-bottom: 5px; }
.grownup-note p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 700; line-height: 1.45; }

.library-hero, .album-hero { display: flex; min-height: 224px; align-items: center; justify-content: space-between; gap: 30px; padding: 36px 48px; overflow: hidden; border: 2px solid color-mix(in srgb, var(--accent, #5aadd5) 35%, var(--line)); border-radius: 34px; background: linear-gradient(115deg, #fffdf7, color-mix(in srgb, var(--accent, #5aadd5) 14%, white)); box-shadow: 0 10px 0 rgba(213, 197, 160, .46), var(--shadow); }
.library-hero h1, .album-hero h1 { font-size: clamp(38px, 5vw, 57px); }
.library-hero p:not(.eyebrow), .album-hero p:not(.eyebrow) { max-width: 690px; margin: 16px 0 0; color: var(--muted); font-size: 16px; font-weight: 700; line-height: 1.5; }
.library-count { display: flex; min-width: 152px; align-items: center; gap: 12px; padding: 17px; border: 2px solid color-mix(in srgb, var(--accent, #5aadd5) 45%, white); border-radius: 22px; background: rgba(255, 255, 255, .72); box-shadow: 0 8px 18px rgba(60, 80, 67, .08); }
.library-count strong { font-size: 37px; color: var(--accent, #5aadd5); }
.library-count span { color: var(--muted); font-size: 11px; font-weight: 900; line-height: 1.3; text-transform: uppercase; }

.collection-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 36px 0 22px; }
.collection-tabs button { display: inline-flex; min-height: 48px; align-items: center; gap: 8px; padding: 0 17px; border: 2px solid #d9ceb3; border-radius: 16px; background: #fffdf7; box-shadow: 0 4px 0 #d9ceb3; font-size: 13px; font-weight: 900; }
.collection-tabs button.active { border-color: #ef9c92; background: #fff0ed; box-shadow: 0 4px 0 #e7aaa3; color: #a64e44; }

.picture-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.picture-card { position: relative; min-width: 0; overflow: hidden; padding: 0; border: 2px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 28px; background: #fffdf7; box-shadow: 0 9px 0 color-mix(in srgb, var(--accent) 18%, #d6c8a8), 0 18px 27px rgba(56, 71, 57, .09); text-align: left; transition: .17s transform, .17s box-shadow; }
.picture-card:hover { transform: translateY(-5px) rotate(.25deg); box-shadow: 0 14px 0 color-mix(in srgb, var(--accent) 18%, #d6c8a8), 0 24px 31px rgba(56, 71, 57, .12); }
.picture-card-art { display: block; aspect-ratio: 7 / 5; padding: 12px; overflow: hidden; border-bottom: 2px dashed #ded2b8; background: color-mix(in srgb, var(--accent) 7%, #fffaf1); }
.picture-card-art .coloring-svg { display: block; width: 100%; height: 100%; }
.picture-card-info { display: flex; min-height: 88px; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; }
.picture-card-info strong { display: block; margin-top: 5px; font-size: 17px; }
.picture-card-info i { display: grid; width: 43px; height: 43px; flex: 0 0 43px; place-items: center; border-radius: 15px; background: color-mix(in srgb, var(--accent) 17%, white); color: var(--accent); font-size: 19px; font-style: normal; font-weight: 900; }
.picture-card.is-complete .picture-card-info i { background: #e4f4e9; color: var(--green-dark); }
.saved-label, .draft-label { position: absolute; top: 14px; right: 14px; padding: 7px 10px; border-radius: 11px; background: #3e9875; box-shadow: 0 4px 0 #28745a; color: white; font-size: 10px; font-style: normal; font-weight: 900; text-transform: uppercase; }
.draft-label { background: #f0ac3c; box-shadow: 0 4px 0 #c88725; }

.album-hero { --accent: #8872b4; }
.album-medal { display: flex; min-width: 190px; flex-direction: column; align-items: center; padding: 18px; border: 2px solid #d5c9e5; border-radius: 27px; background: rgba(255, 255, 255, .72); }
.album-medal > span { font-size: 46px; }
.album-medal strong { margin-top: 5px; font-size: 26px; }
.album-medal small { color: var(--muted); font-weight: 900; }
.album-grid { margin-top: 34px; }
.empty-album { display: grid; min-height: 370px; margin-top: 34px; place-items: center; align-content: center; padding: 35px; border: 2px dashed #d6c8a8; border-radius: 32px; background: rgba(255, 253, 247, .78); text-align: center; }
.empty-album > div { font-size: 78px; }
.empty-album h2 { margin: 10px 0 5px; font-size: 32px; }
.empty-album p { max-width: 520px; margin: 0 0 22px; color: var(--muted); font-weight: 700; }
.album-actions { display: flex; justify-content: center; gap: 18px; margin-top: 36px; }

.secondary-button, .danger-button { min-height: 52px; padding: 0 20px; border: 2px solid #d4c7aa; border-radius: 16px; background: #fffdf7; box-shadow: 0 5px 0 #d4c7aa; font-weight: 900; }
.secondary-button:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #d4c7aa; }

.studio-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 9px 0 18px; }
.studio-head > div:first-child { display: flex; align-items: center; gap: 14px; }
.back-button { display: grid; width: 49px; height: 49px; place-items: center; border: 2px solid #d7c9a8; border-radius: 16px; background: #fffdf7; box-shadow: 0 5px 0 #d7c9a8; font-size: 24px; }
.studio-head h1 { margin: 0; font-size: clamp(27px, 4vw, 42px); line-height: 1; letter-spacing: -.04em; }
.studio-head .eyebrow { margin-bottom: 6px; }
.studio-progress { display: flex; align-items: center; gap: 8px; padding: 11px 15px; border: 2px solid #bfe0cb; border-radius: 16px; background: #f0faef; color: var(--green-dark); font-size: 12px; }
.studio-progress > span { color: #efa92f; font-size: 22px; }

.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 345px; align-items: start; gap: 20px; }
.canvas-panel { position: relative; min-width: 0; padding: 26px 22px 20px; border: 2px solid #d7c8a5; border-radius: 36px; background: linear-gradient(145deg, #fffaf0, #f5edda); box-shadow: 0 12px 0 rgba(210, 192, 150, .48), var(--shadow); }
.canvas-tape { position: absolute; width: 120px; height: 31px; top: -13px; left: calc(50% - 60px); border: 1px solid #d5b86f; background: rgba(248, 217, 128, .67); box-shadow: 0 3px 7px rgba(81, 64, 32, .1); transform: rotate(-2deg); z-index: 4; }
.canvas-wrap { position: relative; overflow: hidden; border: 3px solid #e2d5b7; border-radius: 29px; background: #fffdf7; box-shadow: inset 0 0 0 7px #fff, 0 12px 26px rgba(73, 65, 42, .12); }
.coloring-svg { display: block; width: 100%; height: auto; max-width: 100%; }
.coloring-svg.is-studio { touch-action: none; user-select: none; }
.paper-fill { fill: #fffdf7; }
.paint-zone [data-fill] { fill: #fffdf7; stroke: #365b58; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: filter .16s, opacity .16s; }
.paint-zone:focus, .paint-zone:focus-visible { outline: none; }
.paint-zone:hover [data-fill] { filter: brightness(.97) drop-shadow(0 2px 2px rgba(39, 85, 76, .12)); }
.coloring-svg[data-tool="fill"] .paint-zone { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ctext y='25' font-size='25'%3E%F0%9F%AA%A3%3C/text%3E%3C/svg%3E") 5 26, pointer; }
.coloring-svg[data-tool="brush"] { cursor: crosshair; }
.coloring-svg[data-tool="eraser"] { cursor: cell; }
.ink { pointer-events: none; }
.ink path, .ink circle, .ink rect, .ink ellipse { stroke: #365b58; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ink path { fill: none; }
.brush-stroke { pointer-events: stroke; }
.paint-zone.paint-pop { animation: paint-pop .34s ease; }
.paint-zone.is-hinted [data-fill] { animation: hint-pulse .72s ease-in-out 3; filter: drop-shadow(0 0 8px #f5c84c); }
.canvas-message { display: flex; min-height: 64px; align-items: center; gap: 12px; margin: 15px 4px 0; padding: 11px 15px; border: 2px solid #c9ded1; border-radius: 18px; background: #f2faf3; }
.canvas-message > span { font-size: 25px; }
.canvas-message p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.35; }
.canvas-message b { color: var(--green-dark); }
.canvas-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.canvas-actions button { min-height: 44px; padding: 0 13px; border: 2px solid #d8ccb0; border-radius: 14px; background: #fffdf7; box-shadow: 0 4px 0 #d8ccb0; font-size: 12px; font-weight: 900; }
.canvas-actions button:hover:not(:disabled) { transform: translateY(-2px); }
.canvas-panel.needs-color { animation: gentle-shake .46s ease; }

.toolbox { position: sticky; top: 15px; padding: 21px; border: 2px solid #d7c8a5; border-radius: 32px; background: rgba(255, 253, 247, .95); box-shadow: 0 11px 0 rgba(210, 192, 150, .48), var(--shadow); }
.toolbox-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 2px dashed #dfd2b8; }
.toolbox-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.04em; }
.toolbox-heading .eyebrow { margin-bottom: 5px; font-size: 9px; }
.toolbox-heading > span { font-size: 39px; }
.tool-group { margin-top: 17px; }
.tool-group h3 { margin: 0 0 9px; color: #536b67; font-size: 12px; }
.tool-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.tool-tabs button { display: flex; min-width: 0; min-height: 82px; flex-direction: column; align-items: center; justify-content: center; padding: 7px 4px; border: 2px solid #ddd2b8; border-radius: 15px; background: #fffaf0; }
.tool-tabs button.active { border-color: #78b897; background: #eaf7ed; box-shadow: inset 0 0 0 2px white, 0 4px 0 #a8cfb7; }
.tool-tabs span { font-size: 24px; }
.tool-tabs b { margin-top: 3px; font-size: 11px; }
.tool-tabs small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.1; }
.color-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.color-button { display: grid; aspect-ratio: 1; min-width: 0; place-items: center; padding: 0; border: 3px solid transparent; border-radius: 50%; background: transparent; cursor: pointer; }
.color-button span { width: 100%; height: 100%; border: 2px solid color-mix(in srgb, var(--swatch) 70%, #4d5c55); border-radius: 50%; background: var(--swatch); box-shadow: inset 0 3px 4px rgba(255,255,255,.38), 0 3px 0 color-mix(in srgb, var(--swatch) 68%, #64645a); }
.color-button.active { border-color: var(--ink); transform: scale(1.08); }
.pattern-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.pattern-grid button, .size-grid button { display: flex; min-height: 43px; align-items: center; justify-content: center; gap: 7px; padding: 5px; border: 2px solid #ded2b8; border-radius: 13px; background: #fffaf0; font-size: 10px; font-weight: 900; }
.pattern-grid button.active, .size-grid button.active { border-color: #d8958c; background: #fff0ed; box-shadow: 0 3px 0 #e5b0aa; color: #9b5047; }
.pattern-grid span { font-size: 20px; }
.size-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.size-grid button { min-height: 54px; flex-direction: column; font-size: 8px; }
.size-grid span { width: var(--size); height: var(--size); border-radius: 50%; background: var(--ink); }
.save-button { display: grid; width: 100%; min-height: 69px; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-top: 20px; padding: 10px 14px; border-radius: 18px; background: linear-gradient(180deg, #49a17d, #338866); box-shadow: 0 7px 0 #226b50, 0 12px 21px rgba(37, 117, 84, .2); color: white; text-align: left; }
.save-button > span:first-child { font-size: 27px; }
.save-button b, .save-button small { display: block; }
.save-button b { font-size: 13px; }
.save-button small { margin-top: 3px; color: #ddf4e7; font-size: 8px; }
.save-button i { font-size: 22px; font-style: normal; }
.save-button:hover { transform: translateY(-2px); box-shadow: 0 9px 0 #226b50, 0 15px 24px rgba(37, 117, 84, .23); }

.confirm-dialog { width: min(440px, calc(100% - 28px)); padding: 28px; border: 2px solid #dfcfaa; border-radius: 28px; background: #fffdf7; box-shadow: 0 28px 70px rgba(34, 55, 49, .28); color: var(--ink); text-align: center; }
.confirm-dialog::backdrop { background: rgba(36, 65, 59, .42); backdrop-filter: blur(3px); }
.dialog-art { font-size: 55px; }
.confirm-dialog h2 { margin: 8px 0; font-size: 28px; }
.confirm-dialog p { margin: 0; color: var(--muted); font-weight: 700; line-height: 1.45; }
.confirm-dialog > div:last-child { display: flex; justify-content: center; gap: 12px; margin-top: 22px; }
.danger-button { border-color: #e5aaa3; background: #fff0ed; box-shadow: 0 5px 0 #e5aaa3; color: #a84f45; }

.result-card { position: relative; display: grid; min-height: 600px; grid-template-columns: .9fr 1.1fr; align-items: center; gap: 42px; overflow: hidden; padding: 55px; border: 2px solid #d5c6a3; border-radius: 42px; background: linear-gradient(120deg, #fffdf7, #eef8e9 52%, #f5effc); box-shadow: 0 13px 0 rgba(208, 188, 142, .46), var(--shadow); }
.result-copy { position: relative; z-index: 2; }
.result-badge { display: grid; width: 64px; height: 64px; margin-bottom: 18px; place-items: center; border: 4px solid white; border-radius: 50%; background: #52aa80; box-shadow: 0 6px 0 #2d7d5d, 0 10px 22px rgba(47, 116, 82, .2); color: white; font-size: 32px; font-weight: 900; }
.result-copy h1 { font-size: clamp(42px, 5vw, 63px); }
.result-copy > p:not(.eyebrow) { margin: 21px 0 0; color: var(--muted); font-size: 16px; font-weight: 700; line-height: 1.5; }
.result-stats { display: flex; gap: 11px; margin-top: 23px; }
.result-stats span { display: flex; min-width: 128px; flex-direction: column; padding: 12px 15px; border: 2px solid #d5ddc8; border-radius: 17px; background: rgba(255, 255, 255, .7); }
.result-stats strong { font-size: 21px; }
.result-stats small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.result-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; margin-top: 26px; }
.result-frame { position: relative; padding: 22px 22px 18px; border: 13px solid #efc768; border-radius: 14px; background: #fffdf7; box-shadow: 0 22px 30px rgba(60, 67, 50, .2); transform: rotate(2.2deg); z-index: 2; }
.result-frame::before { position: absolute; inset: 5px; border: 2px solid #c89c42; border-radius: 3px; content: ""; pointer-events: none; }
.result-frame .coloring-svg { display: block; }
.result-frame > b, .result-frame > small { display: block; position: relative; text-align: center; z-index: 2; }
.result-frame > b { margin-top: 8px; font: 900 18px Georgia, serif; }
.result-frame > small { margin-top: 3px; color: var(--muted); font-weight: 700; }
.frame-pin { position: absolute; width: 17px; height: 17px; top: -24px; border: 3px solid white; border-radius: 50%; background: var(--coral); box-shadow: 0 3px 5px rgba(44, 51, 38, .2); }
.pin-left { left: 24%; }.pin-right { right: 24%; }
.confetti { position: absolute; width: 18px; height: 42px; border-radius: 8px; opacity: .75; }
.c1 { top: 8%; left: 48%; background: var(--coral); transform: rotate(27deg); }
.c2 { top: 16%; right: 5%; background: var(--yellow); transform: rotate(-25deg); }
.c3 { bottom: 8%; left: 47%; background: var(--blue); transform: rotate(50deg); }
.c4 { bottom: 5%; right: 8%; background: var(--purple); transform: rotate(-11deg); }

.toast { position: fixed; max-width: min(420px, calc(100% - 28px)); left: 50%; bottom: 28px; padding: 14px 19px; border: 2px solid #d7c69d; border-radius: 17px; background: #fffdf7; box-shadow: 0 14px 35px rgba(38, 61, 54, .2); color: var(--ink); font-size: 13px; font-weight: 900; opacity: 0; transform: translate(-50%, 18px); transition: .22s opacity, .22s transform; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes float { 50% { transform: translateY(-7px) rotate(-3deg); } }
@keyframes twinkle { 50% { opacity: .45; transform: scale(.78) rotate(14deg); } }
@keyframes paint-pop { 50% { transform: scale(1.025); transform-origin: center; } }
@keyframes hint-pulse { 50% { opacity: .58; } }
@keyframes gentle-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

@media (max-width: 1000px) {
  .hero-card { min-height: 460px; }
  .hero-copy { padding-left: 42px; }
  .hero-paper { width: 330px; }
  .studio-layout { grid-template-columns: minmax(0, 1fr) 306px; gap: 14px; }
  .toolbox { padding: 16px; }
  .tool-tabs small { display: none; }
  .result-card { gap: 25px; padding: 40px; }
}

@media (max-width: 820px) {
  .hero-card { grid-template-columns: 1fr; min-height: 745px; background: linear-gradient(180deg, #fffdf4 0 55%, #e1f4e6 55%); }
  .hero-copy { justify-content: flex-start; padding: 55px 42px 20px; }
  .hero-art { min-height: 315px; }
  .hero-paper { width: 355px; max-width: 62%; }
  .steps-grid, .collection-grid { grid-template-columns: 1fr; }
  .steps-grid article { min-height: 132px; }
  .collection-card { min-height: 154px; }
  .picture-grid { grid-template-columns: repeat(2, 1fr); }
  .studio-layout { grid-template-columns: 1fr; }
  .toolbox { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
  .toolbox-heading, .save-button { grid-column: 1 / -1; }
  .save-button { max-width: 520px; justify-self: center; }
  .result-card { grid-template-columns: 1fr; }
  .result-frame { width: min(560px, 90%); justify-self: center; }
}

@media (max-width: 620px) {
  .app { width: min(100% - 20px, 1120px); padding-top: 12px; }
  .game-topbar { align-items: flex-start; }
  .brand-icon { width: 50px; height: 50px; }
  .brand-button strong { font-size: 17px; }
  .brand-button small { max-width: 145px; }
  .top-actions { gap: 7px; }
  .soft-button { min-width: 48px; min-height: 48px; justify-content: center; padding: 7px; }
  .soft-button b { display: none; }
  .soft-button small { min-width: 39px; }
  .sound-button { display: none; }
  .hero-card { min-height: 700px; border-radius: 30px; }
  .hero-copy { padding: 48px 22px 16px; }
  .hero-copy h1 { font-size: clamp(43px, 14vw, 60px); }
  .hero-copy > p:not(.eyebrow) { margin-top: 17px; font-size: 15px; }
  .hero-actions { align-items: stretch; flex-direction: column; gap: 10px; margin-top: 20px; }
  .hero-actions .text-button { align-self: flex-start; }
  .hero-stat { margin-top: 15px; }
  .hero-art { min-height: 270px; }
  .hero-paper { max-width: 80%; }
  .hero-brush { font-size: 54px; }
  .hero-pencil { font-size: 47px; }
  .how-section, .collections-section { margin-top: 45px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .section-heading > p { text-align: left; }
  .section-heading h2 { font-size: 35px; }
  .steps-grid article { grid-template-columns: 58px 1fr; padding: 22px 16px; }
  .steps-grid article > i { width: 58px; height: 58px; font-size: 29px; }
  .grownup-note { align-items: flex-start; padding: 19px; }
  .library-hero, .album-hero { align-items: flex-start; flex-direction: column; padding: 28px 22px; border-radius: 27px; }
  .library-count { min-width: 0; align-self: stretch; justify-content: center; }
  .collection-tabs { flex-wrap: nowrap; margin-right: -10px; padding: 4px 10px 8px 0; overflow-x: auto; scrollbar-width: thin; }
  .collection-tabs button { flex: 0 0 auto; }
  .picture-grid { grid-template-columns: 1fr; gap: 16px; }
  .picture-card-art { aspect-ratio: 7 / 4.5; padding: 7px 19px; }
  .album-actions { align-items: stretch; flex-direction: column; }
  .studio-head { align-items: flex-start; flex-direction: column; }
  .studio-progress { align-self: stretch; }
  .canvas-panel { padding: 20px 9px 15px; border-radius: 27px; }
  .canvas-wrap { border-radius: 21px; }
  .paint-zone [data-fill], .ink path, .ink circle, .ink rect, .ink ellipse { stroke-width: 6; }
  .canvas-message { margin-inline: 0; }
  .canvas-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbox { grid-template-columns: 1fr; padding: 17px; border-radius: 27px; }
  .toolbox-heading, .save-button { grid-column: auto; }
  .tool-tabs button { min-height: 73px; }
  .color-grid { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .result-card { padding: 32px 20px; border-radius: 30px; }
  .result-copy h1 { font-size: 43px; }
  .result-frame { width: 100%; padding: 13px; border-width: 9px; }
  .result-actions { align-items: stretch; flex-direction: column; }
  .result-actions .text-button { align-self: center; }
  .result-stats { flex-direction: column; }
}

@media (max-width: 390px) {
  .app { width: calc(100% - 14px); }
  .brand-button { gap: 8px; }
  .brand-icon { width: 46px; height: 46px; border-radius: 15px; font-size: 24px; }
  .brand-button strong { font-size: 15px; }
  .brand-button small { font-size: 8px; }
  .hero-card { min-height: 686px; }
  .hero-copy h1 { font-size: 45px; }
  .hero-copy { padding-inline: 18px; }
  .hero-paper { max-width: 88%; }
  .collection-card { grid-template-columns: 54px 1fr; padding-inline: 15px; }
  .collection-icon { width: 54px; height: 54px; font-size: 27px; }
  .picture-card-info strong { font-size: 16px; }
  .canvas-actions button { padding-inline: 7px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

.print-sheet { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body > * { display: none !important; }
  body > .print-sheet { display: grid !important; width: 100%; height: 100%; place-items: center; background: #fff; }
  .print-sheet__art { width: min(245mm, 100%); }
  .print-sheet .result-frame { width: 100%; margin: 0; transform: none; box-shadow: none; }
  .print-sheet .coloring-svg { display: block; width: 100%; max-height: 160mm; }
}
