/* duggy.fun: ms paint / win98. every frame, button, line, divider and icon is a painted png from art.py */
:root {
  --ink: #000; --paper: #fff; --grey: #c0c0c0; --grey-d: #808080;
  --fur: #b5835a; --ear: #7a4f2d; --snout: #d6aa7a; --dirt: #58341a; --soil: #784e2c; --hole: #1c100a;
  --gold: #ffc90e; --gold-hi: #fff200; --red: #ed1c24; --green: #22b14c; --sky: #99d9ea;
  --comic: "Comic Sans MS", "Comic Sans", "Comic Neue", "Chalkboard SE", cursive;
  --shovel: url(/img/cursor-shovel.png) 3 28, crosshair;
}
@property --d { syntax: "<length-percentage>"; inherits: false; initial-value: 0%; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 19px/1.45 var(--comic); -webkit-text-size-adjust: 100%;
  cursor: var(--shovel); overflow-x: hidden; }
a, button, label, input, select, summary, [role="button"] { cursor: pointer; }
input[type="text"] { cursor: text; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
code { font-family: var(--comic); }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; padding: 6px 12px; background: var(--gold); outline: 4px solid var(--ink); }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }

/* ---------- painted frames (9-slice) ---------- */
.win, .tile, .gloss li, .field-wrap {
  border: 10px solid transparent;
  border-image: url(/img/frame.png) 28 fill / 28px / 0 7px 7px 0 round;
}
.field, .ca-text, .row input[type="text"] {
  border: 6px solid transparent;
  border-image: url(/img/frame-thin.png) 16 fill / 16px round;
  background: none;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 2px 14px;
  font-weight: 700; text-decoration: none; user-select: none; background: none;
  border: 9px solid transparent; border-image: url(/img/btn.png) 20 fill / 20px / 0 5px 5px 0 round;
}
.btn.gold { border-image-source: url(/img/btn-gold.png); }
.btn:hover { border-image-source: url(/img/btn-hi.png); }
.btn:active { border-image-source: url(/img/btn-down.png); transform: translate(4px, 4px); }
.btn.on { border-image-source: url(/img/btn-gold.png); }
.btn small { font-weight: 400; font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; color: #888; border-image-source: url(/img/btn-off.png); transform: none; }
.btn.tiny { min-height: 38px; padding: 0 8px; font-size: 16px; border-width: 7px; border-image-width: 16px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; }

/* window chrome */
.title { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 3px 6px 7px 10px; margin: -1px -1px 0;
  background: var(--dirt) url(/img/line-h.png) repeat-x left bottom / 300px 6px; color: #fff; font-weight: 700; font-size: 17px; }
.title > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbb { width: 77px; height: 24px; flex: none; image-rendering: pixelated; }
.title .x { width: 34px; height: 30px; padding: 0; font-weight: 700; color: var(--ink); background: var(--grey);
  border: 3px solid; border-color: #fff var(--ink) var(--ink) #fff; }
.title .x:hover { background: var(--gold-hi); }
.menu { display: flex; gap: 18px; padding: 2px 12px 6px; font-size: 16px; background: url(/img/line-h.png) repeat-x left bottom / 300px 5px; }
.txt { padding: 16px 20px; }
.txt p { margin: 0 0 12px; }
.txt p:last-child { margin-bottom: 0; }
.small { font-size: 15px; }
.muted { color: #444; }
.hl { background: var(--gold-hi); padding: 0 4px; }
.gold-txt { display: inline-block; padding: 0 10px 2px; transform: rotate(-1.2deg);
  border: 8px solid transparent; border-image: url(/img/btn-gold.png) 20 fill / 20px / 0 5px 5px 0 round; }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 8px 14px 12px;
  background: var(--paper) url(/img/line-h.png) repeat-x left bottom / 300px 6px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; flex: none; }
.brand img { border-radius: 50%; outline: 3px solid var(--ink); }
.brand b { font-size: 27px; }
.bar nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-left: auto; min-width: 0; }
.bar nav::-webkit-scrollbar { display: none; }
.bar nav a { flex: none; padding: 2px 9px 6px; text-decoration: none; }
.bar nav a:hover { background: url(/img/scribble.png) no-repeat center bottom / 100% 12px; }
.bar nav a:focus-visible { outline-offset: -3px; } /* the nav scrolls sideways, so an outside ring gets clipped */
.snd { flex: none; width: 46px; height: 46px; padding: 0; display: grid; place-items: center; background: none;
  border: 7px solid transparent; border-image: url(/img/btn.png) 20 fill / 18px / 0 4px 4px 0 round; }
.snd img { width: 28px; height: 28px; image-rendering: pixelated; }
.snd[aria-pressed="true"] { border-image-source: url(/img/btn-gold.png); }

/* ---------- boil (2-frame line wobble): app.js flips html.boil-b; webkit drops visibility keyframes ---------- */
.boil { position: relative; display: block; }
.boil > img { display: block; width: 100%; height: auto; }
.boil > img + img { position: absolute; inset: 0; visibility: hidden; }
.boil-b .boil > img:first-child { visibility: hidden; }
.boil-b .boil > img + img { visibility: visible; }

/* ---------- hero ---------- */
.hero { max-width: 1280px; margin: 0 auto; padding: 24px clamp(10px, 3vw, 40px) 26px; display: grid; gap: 30px; }
.paint-win { background: none; }
.paint-body { display: flex; background: var(--grey); }
.toolbox { flex: none; display: grid; align-content: start; gap: 6px; padding: 8px 10px 8px 8px;
  background: url(/img/line-v.png) repeat-y right top / 5px 300px; }
.tool { width: 56px; height: 56px; display: grid; place-items: center; padding: 0; background: var(--grey);
  border: 3px solid; border-color: #fff var(--ink) var(--ink) #fff; }
.tool img { width: 40px; height: 40px; image-rendering: pixelated; }
.tool.on { border-color: var(--ink) #fff #fff var(--ink); background: #ecebe2 repeating-conic-gradient(#fff 0 25%, #ddd 0 50%) 0 0 / 4px 4px; }
.tool:hover { background: var(--gold-hi); }
.dig-area { position: relative; flex: 1; min-width: 0; height: clamp(440px, 64vh, 640px); background: var(--paper); overflow: hidden; }
.under { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1.15fr; align-items: center; gap: 2vw; padding: 3% 4%;
  background: var(--under, #fff); transition: background .2s steps(2); }
.logo { width: min(100%, 520px); }
.hero h1 { margin: 14px 0 4px; font-size: clamp(25px, 3.1vw, 44px); line-height: 1.4; }
.still { margin: 6px 0 0; font-size: clamp(20px, 2vw, 28px); }
.under-duggy { width: 100%; }
.nug { position: absolute; z-index: 1; height: auto; pointer-events: none; image-rendering: pixelated; }
.nug.found { animation: ding .7s steps(7) both; }
@keyframes ding { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-34px) scale(1.4) rotate(-12deg); }
  55% { transform: translateY(0) scale(.9, 1.1); } 75% { transform: translateY(-10px) scale(1.1); } 100% { transform: translateY(0) scale(1.1); } }
/* pan-y: on phones a vertical swipe scrolls the page, a sideways stroke digs */
#dirt { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; image-rendering: pixelated; touch-action: pan-y; cursor: var(--shovel); }
.dig-say { position: absolute; z-index: 4; right: 14px; bottom: 14px; max-width: 72%; margin: 0; padding: 4px 14px; font-weight: 700; pointer-events: none;
  border: 10px solid transparent; border-image: url(/img/frame.png) 28 fill / 28px / 0 7px 7px 0 round; opacity: 0; transition: opacity .15s steps(2); }
.dig-say.show { opacity: 1; }
.plus { position: absolute; z-index: 5; padding: 0 8px; font-weight: 700; font-size: 22px; white-space: nowrap; pointer-events: none;
  background: var(--gold); outline: 3px solid var(--ink); animation: plus 1.1s steps(8) forwards; }
@keyframes plus { to { transform: translateY(-64px); opacity: 0; } }
.crumb { position: absolute; z-index: 6; pointer-events: none; outline: 1px solid #000; }
.colorbox { display: flex; align-items: center; gap: 10px; padding: 8px 10px 6px; background: var(--grey) url(/img/line-h.png) repeat-x left top / 300px 5px; }
.cur { position: relative; flex: none; width: 46px; height: 40px; background: #fff; border: 3px solid; border-color: var(--grey-d) #fff #fff var(--grey-d); }
.cur i { position: absolute; width: 20px; height: 18px; outline: 2px solid #000; }
#cur-a { left: 6px; top: 5px; background: var(--under, #fff); z-index: 1; }
#cur-b { left: 16px; top: 13px; background: var(--soil); }
.swatches { display: grid; grid-template-columns: repeat(14, 22px); grid-auto-rows: 18px; gap: 3px; }
.swatches button { width: 22px; height: 18px; padding: 0; border: 2px solid; border-color: var(--grey-d) #fff #fff var(--grey-d); outline: 1px solid #000; }
.swatches button.on { outline: 3px solid #000; }
.status { display: flex; flex-wrap: wrap; gap: 4px 22px; padding: 8px 12px 6px; font-size: 16px; background: var(--grey) url(/img/line-h.png) repeat-x left top / 300px 5px; }
.status b { display: inline-block; min-width: 2.4ch; padding: 0 6px; background: var(--paper); border: 2px solid; border-color: var(--grey-d) #fff #fff var(--grey-d); }

/* CA */
.ca-win { width: 100%; max-width: 920px; justify-self: center; }
.ca-body { padding: 14px 20px 20px; }
.label { margin: 0 0 6px; font-weight: 700; }
.ca-row { display: flex; gap: 12px; align-items: center; }
.ca-text { flex: 1; min-width: 0; display: flex; align-items: center; min-height: 52px; padding: 4px 10px; font-size: 18px; word-break: break-all; }
.ca-text.empty { font-style: italic; color: #555; }
.ca-note { margin: 10px 0 14px; font-size: 15px; }
.links { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- sections ---------- */
.ground { height: 58px; margin: 18px 0 0; background: url(/img/divider.png) repeat-x left center / auto 58px; }
.sec { max-width: 1280px; margin: 0 auto; padding: 30px clamp(10px, 3vw, 40px) 26px; }
.h { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; font-size: clamp(38px, 6vw, 72px); line-height: 1.1; }
.h img { flex: none; width: clamp(44px, 6vw, 64px); height: auto; image-rendering: pixelated; }
.h span { padding: 0 6px 10px 2px; color: var(--fur); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  background: url(/img/scribble.png) no-repeat left bottom / 100% 20px; }
#gold .h span { color: var(--gold); }
.sub { margin: 0 0 20px; font-size: 20px; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: start; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 14px; margin: 0; align-items: center; }
.kv dt { font-weight: 700; }
.kv dd { margin: 0; min-width: 0; word-break: break-all; }
.mint { display: block; margin-bottom: 6px; padding: 2px 6px; background: #f4f4f4; outline: 2px solid var(--ink); font-size: 15px; word-break: break-all; }
.pair-state { display: inline-block; margin: 0 0 16px !important; padding: 0 12px; font-weight: 700;
  border: 8px solid transparent; border-image: url(/img/btn-gold.png) 20 fill / 20px / 0 5px 5px 0 round; }
.story p { font-size: 21px; }
.sig { font-weight: 700; font-size: 28px !important; }

/* pop out of a hole */
.pop { position: relative; width: 100%; max-width: 380px; margin: 0 auto 8px; aspect-ratio: 800 / 410; }
.pop-l, .pop-clip, .pop-dog, .pop-dog > *, .pop-tongue { position: absolute; inset: 0; width: 100%; height: 100%; }
.pop-clip { overflow: hidden; height: 74.6%; } /* clip line = hole rim (art.py prints it) */
.pop-dog { height: calc(100% / .746); transform: translateY(66%); transition: transform .45s steps(5); }
.pop.up .pop-dog { transform: none; }
.pop-tongue { transform-origin: 50.1% 70.2%; animation: wag .6s steps(2) infinite; }
@keyframes wag { 0% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
.who .txt::after { content: ""; display: block; clear: both; }

/* glossary */
.gloss { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
.gloss li { padding: 8px 14px 12px; }
.gloss li:nth-child(3n+2) { transform: rotate(.7deg); }
.gloss li:nth-child(3n) { transform: rotate(-.6deg); }
.gloss li.goldy { border-image-source: url(/img/frame-gold.png); }
.gloss dfn { display: block; font-style: normal; font-weight: 700; font-size: 25px; }
.gloss span { display: block; color: #222; }

/* galleries */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 20px; }
.grid.comics { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
.grid.threads { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.stickers { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cell { position: relative; min-width: 0; }
.tile { display: block; width: 100%; padding: 0; text-align: left; background: none; cursor: zoom-in; }
.tile:hover { border-image-source: url(/img/frame-gold.png); transform: rotate(-.8deg); }
.tile img, .tile video { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: #fff; }
.comics .tile img { aspect-ratio: auto; object-fit: contain; }
.threads .tile img { aspect-ratio: 3 / 4; object-fit: cover; object-position: left top; }
.stickers .tile img { object-fit: contain; padding: 6px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 18px 18px; }
.stickers .tile .cap { display: none; }
.tile .cap { display: block; padding: 6px 66px 2px 8px; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: url(/img/line-h.png) repeat-x left top / 300px 5px; }
.cell .dl { position: absolute; right: 12px; bottom: 11px; z-index: 1; min-height: 32px; padding: 0 6px; font-size: 14px; border-width: 6px; border-image-width: 14px; }

/* tv */
.tv { display: grid; gap: 30px; align-items: start; }
.tv.both { grid-template-columns: minmax(0, 700px) minmax(0, 1fr); }
.video-win { max-width: 760px; width: 100%; }
.video-body video { display: block; width: 100%; height: auto; background: #000; }
.video-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 12px 6px; background: var(--grey) url(/img/line-h.png) repeat-x left top / 300px 5px; }
.reels { display: flex; gap: 22px; overflow-x: auto; padding: 4px 4px 16px; scroll-snap-type: x mandatory; }
.reel { position: relative; flex: none; width: 230px; scroll-snap-align: start; } /* relative: keeps the .vh alt text inside the scroller */
.reel .win { padding: 0; }
.reel .frame916 { position: relative; aspect-ratio: 9 / 16; background: #000; }
.reel .frame916 > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel button.play { display: grid; place-items: end center; padding: 0 0 16px; border: 0; background: none; }
.reel button.play img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel button.play span { position: relative; padding: 2px 14px; font-weight: 700; border: 8px solid transparent;
  border-image: url(/img/btn-gold.png) 20 fill / 20px / 0 5px 5px 0 round; }
.reel p { margin: 8px 2px 0; font-size: 16px; }

/* ---------- meme maker ---------- */
.maker { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); background: var(--grey); }
.m-stage { position: sticky; top: 76px; align-self: start; padding: 14px; background: var(--grey-d) url(/img/line-v.png) repeat-y right top / 5px 300px; }
/* page scrolls over the canvas until u pick a thing; then the canvas owns the finger */
#mk { display: block; width: 100%; height: auto; aspect-ratio: 1; background: #fff; outline: 3px solid var(--ink); touch-action: pan-y; cursor: grab; image-rendering: pixelated; }
#mk.picked { touch-action: none; }
#mk.drag { cursor: grabbing; }
.m-hint { margin: 8px 0 0; font-size: 15px; color: #fff; }
.m-side { padding: 12px 14px 16px; display: grid; gap: 10px; align-content: start; }
fieldset { margin: 0; padding: 6px 10px 12px; border: 3px solid; border-color: var(--grey-d) #fff #fff var(--grey-d); }
legend { padding: 0 6px; font-weight: 700; }
.m-bgs, .m-sprites { display: flex; flex-wrap: wrap; gap: 6px; }
.m-bgs button, .m-sprites button { width: 56px; height: 56px; padding: 2px; background: #fff; border: 3px solid; border-color: #fff var(--ink) var(--ink) #fff; }
.m-bgs button img, .m-sprites button img { display: block; width: 100%; height: 100%; object-fit: contain; }
.m-bgs button.on { outline: 4px solid var(--gold); border-color: var(--ink); }
.m-sprites { max-height: 200px; overflow-y: auto; }
.m-sprites button:hover, .m-bgs button:hover { background: var(--gold-hi); }
.palette { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 3px; margin-top: 8px; }
.palette button { aspect-ratio: 1.2; min-width: 0; padding: 0; border: 2px solid; border-color: var(--grey-d) #fff #fff var(--grey-d); outline: 1px solid var(--ink); }
.palette button.on { outline: 3px solid var(--ink); position: relative; }
.row { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; margin: 4px 0; }
.row input[type="text"] { width: 100%; min-width: 0; padding: 4px 6px; }
.row input[type="range"] { width: 100%; accent-color: var(--dirt); }
.m-msg { margin: 0; min-height: 1.4em; font-size: 16px; }

/* how to buy */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 24px; }
.steps .txt { font-size: 17px; }
.steps .title { background-color: var(--soil); }
.steps li:nth-child(even) { transform: rotate(.6deg); }

/* article */
.article-win { max-width: 900px; }
.article-body img { display: block; width: 100%; }

/* footer */
.foot { max-width: 940px; margin: 30px auto 0; padding: 0 clamp(10px, 3vw, 40px) 40px; text-align: center; }
.small-pop { max-width: 260px; }
.foot-win { text-align: left; }
.bye { margin: 18px 0 0; font-weight: 700; font-size: 24px; }

/* click holes */
.holes { position: absolute; left: 0; top: 0; width: 100%; height: 0; z-index: 25; pointer-events: none; }
.holes img { position: absolute; transform: translate(-50%, -50%); image-rendering: pixelated; animation: holeIn .25s steps(3) both; }
.holes img.out { animation: holeOut .5s steps(4) forwards; }
@keyframes holeIn { from { transform: translate(-50%, -50%) scale(.2); } }
@keyframes holeOut { to { transform: translate(-50%, -50%) scale(.2); opacity: 0; } }

/* dig-wipe reveal: jagged dirt edge walks down the block */
.js .dig-in:not(.dug) { clip-path: inset(0 0 100% 0); }
.js .dig-in.digging {
  clip-path: polygon(-30px -30px, calc(100% + 30px) -30px, calc(100% + 30px) var(--d), 93% calc(var(--d) + 16px), 85% calc(var(--d) - 4px),
    76% calc(var(--d) + 22px), 66% calc(var(--d) + 2px), 57% calc(var(--d) + 18px), 46% calc(var(--d) - 6px), 37% calc(var(--d) + 14px),
    27% calc(var(--d) + 3px), 18% calc(var(--d) + 20px), 8% calc(var(--d) - 2px), -30px calc(var(--d) + 12px));
  animation: wipe .8s steps(8) forwards;
}
@keyframes wipe { from { --d: -30px; } to { --d: calc(100% + 40px); } }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 14px; background: rgba(255, 255, 255, .9); cursor: default; }
.lb-win { width: min(900px, 100%); max-height: calc(100dvh - 28px); display: flex; flex-direction: column; }
.lb-body { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #fff; }
.lb-media { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; width: 100%; min-width: 0; min-height: 0; padding: 10px 50px; }
.lb-media img, .lb-media video { display: block; max-width: 100%; max-height: calc(100dvh - 190px); object-fit: contain; }
.lb-media video { width: min(100%, 480px, calc(100dvh - 190px)); height: auto; background: #fff; }
.lb-media.chk img { background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 20px 20px; }
.lb-nav { position: absolute; top: 50%; z-index: 2; width: 44px; height: 60px; transform: translateY(-50%); font-size: 26px; font-weight: 700;
  background: var(--grey); border: 3px solid; border-color: #fff var(--ink) var(--ink) #fff; }
.lb-nav.prev { left: 4px; }
.lb-nav.next { right: 4px; }
.lb-nav:hover { background: var(--gold-hi); }
.lb-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px 4px; background: var(--grey) url(/img/line-h.png) repeat-x left top / 300px 5px; }
.lb-bar span { margin-right: auto; }

.toast { position: fixed; left: 50%; bottom: 22px; z-index: 60; padding: 2px 16px; font-weight: 700; pointer-events: none;
  border: 9px solid transparent; border-image: url(/img/btn-gold.png) 20 fill / 20px / 0 5px 5px 0 round;
  transform: translate(-50%, calc(100% + 60px)); transition: transform .15s steps(3); }
.toast.show { transform: translate(-50%, 0); }

/* 404 */
.nf { min-height: 86vh; display: grid; place-items: center; padding: 30px 12px; }
.nf .win { width: 100%; max-width: 640px; }
.nf .txt { text-align: center; }
.nf h1 { margin: 6px 0; font-size: clamp(34px, 7vw, 56px); color: var(--fur); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cols, .maker, .tv.both { grid-template-columns: 1fr; }
  .m-stage { position: static; background-image: url(/img/line-h.png); background-repeat: repeat-x; background-position: left bottom; background-size: 300px 5px; }
  .under { grid-template-columns: 1fr; align-content: center; justify-items: center; text-align: center; padding: 14px 12px; gap: 4px; }
  .logo { width: min(82%, 420px); }
  .under-duggy { width: min(100%, 440px); }
}
@media (max-width: 640px) {
  body { font-size: 18px; }
  .bar { gap: 8px; padding: 6px 8px 10px; }
  .brand b { display: none; }
  .bar nav a { padding: 2px 6px 6px; }
  .menu { display: none; }
  .paint-body { flex-direction: column; }
  .toolbox { grid-template-columns: repeat(4, 56px); justify-content: center; padding: 6px 6px 10px;
    background: url(/img/line-h.png) repeat-x left bottom / 300px 5px; }
  .dig-area { flex: none; height: 520px; }
  .hero h1 { font-size: 26px; }
  .swatches { grid-template-columns: repeat(14, minmax(0, 1fr)); flex: 1; gap: 2px; }
  .swatches button { width: auto; }
  .cur { display: none; }
  .ca-row { flex-direction: column; align-items: stretch; }
  .txt { padding: 12px 12px; }
  .story p { font-size: 19px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid.threads, .grid.comics { grid-template-columns: 1fr; }
  .grid.stickers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile .cap { font-size: 14px; padding: 4px 4px 0; }
  .cell .dl { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .reel { width: 64vw; }
  .lb { padding: 4px; }
  .lb-media { padding: 6px 4px; }
  .lb-nav { width: 36px; height: 50px; opacity: .9; }
  .h span { -webkit-text-stroke-width: 2.5px; }
}

/* ---------- fingers: bigger tap targets, same paint look ---------- */
@media (pointer: coarse) {
  .bar nav a { display: flex; align-items: center; min-height: 44px; }
  .brand { min-height: 44px; }
  .btn.tiny { min-height: 44px; }
  .swatches { grid-auto-rows: 30px; }
  .swatches button { height: 30px; }
  .palette { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .row input[type="range"] { height: 40px; }
  .lb-nav { width: 44px; height: 56px; }
}

/* ---------- less motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pop-tongue, .nug.found, .plus, .holes img { animation: none !important; }
  .pop-dog { transition: none; transform: none; }
  .js .dig-in:not(.dug), .js .dig-in.digging { clip-path: none; animation: none; }
  .tile:hover { transform: none; }
  .under, .dig-say, .toast { transition: none; }
}
