/* Doodelize: everything is on paper. One typeface (Shantell Sans), crayon colours, drawn borders. */
:root {
  --paper: #fbf8ef; --rule: #a9c6e8; --margin: #e9838c; --ink: #2b2b2b; --pencil: #6b6b6b; --faint: #a8a8a8;
  --red: #e63b2e; --orange: #f0862b; --yellow: #f2c230; --green: #3da35d; --blue: #2e6fe6; --purple: #8e4fd1; --pink: #ef5da8;
  --sticky: #fff3a1; --white: #fffdf7;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Shantell Sans", "Comic Sans MS", cursive; color: var(--ink); background: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px);
  -webkit-font-smoothing: antialiased; line-height: 1.35;
}
body::before { content: ""; position: fixed; left: 56px; top: 0; bottom: 0; width: 1.5px; background: var(--margin); opacity: .9; pointer-events: none; }
@media (max-width: 600px) { body::before { left: 28px; } }
a { color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
.wobbly { filter: url(#wobble); }

.page { max-width: 1040px; margin: 0 auto; padding: 14px 16px 48px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 6px; white-space: nowrap; }
.logo { font-weight: 800; font-size: 30px; letter-spacing: -.5px; text-decoration: none; color: var(--ink); line-height: 1; }
.logo span { display: inline-block; transform: rotate(-4deg); color: var(--red); }
nav.links { display: flex; gap: 14px; font-weight: 700; font-size: 16px; align-items: center; }
@media (max-width: 600px) { .logo { font-size: 24px; } nav.links { gap: 10px; font-size: 14px; } }
nav.links a { color: var(--ink); }
.prompt { font-size: 20px; font-weight: 700; margin: 6px 0 10px; min-height: 28px; }
.prompt small { display: block; font-weight: 400; font-size: 15px; color: var(--pencil); }

.studio { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 820px) { .studio { grid-template-columns: minmax(420px, 560px) 1fr; align-items: start; } }
.sheet { position: relative; width: 100%; aspect-ratio: 1; max-width: 560px; background: var(--white); border: 2.5px solid var(--ink); border-radius: 18px 14px 20px 12px / 14px 20px 12px 18px; box-shadow: 4px 5px 0 rgba(43,43,43,.18); overflow: hidden; touch-action: none; }
.sheet canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sheet .hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 14px; color: var(--faint); pointer-events: none; }
.tape { position: absolute; width: 70px; height: 22px; background: rgba(242,194,48,.55); transform: rotate(-6deg); top: -8px; left: 50%; margin-left: -35px; border-radius: 2px; }

.tools { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { background: var(--white); border: 2.5px solid var(--ink); border-radius: 14px 10px 16px 9px / 10px 16px 9px 14px; padding: 8px 14px; font-weight: 700; font-size: 16px; cursor: pointer; box-shadow: 2px 3px 0 rgba(43,43,43,.2); transition: transform .08s; }
.btn:hover { transform: translate(-1px, -1px); } .btn:active { transform: translate(1px, 2px); box-shadow: none; }
.btn.on { background: var(--yellow); }
.btn.big { font-size: 22px; padding: 14px 26px; border-radius: 22px 16px 24px 14px / 16px 24px 14px 22px; box-shadow: 3px 4px 0 rgba(43,43,43,.25); }
.btn.primary { background: var(--red); color: #fff; border-color: #8e1d14; }
.btn.quiet { box-shadow: none; border-color: var(--pencil); color: var(--pencil); background: transparent; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn:focus-visible, .crayon:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.crayon { width: 30px; height: 44px; border: 2px solid rgba(0,0,0,.35); border-radius: 6px 6px 3px 3px; cursor: pointer; position: relative; background: var(--c); box-shadow: inset -5px 0 0 rgba(0,0,0,.12); }
.crayon::before { content: ""; position: absolute; left: 6px; right: 6px; top: -9px; height: 10px; background: var(--c); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.crayon.on { transform: translateY(-6px); box-shadow: inset -5px 0 0 rgba(0,0,0,.12), 0 6px 0 rgba(43,43,43,.15); }
.size { width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--white); display: grid; place-items: center; cursor: pointer; }
.size i { display: block; background: var(--ink); border-radius: 50%; }
.size.on { background: var(--yellow); }
.label { font-size: 13px; color: var(--pencil); margin-right: 2px; }
.step { display: none; } .step.on { display: block; }
.alive { display: grid; gap: 10px; }
.nameplate { font-size: 34px; font-weight: 800; line-height: 1.05; min-height: 40px; }
.nameplate .cursor { display: inline-block; width: 3px; height: 30px; background: var(--ink); margin-left: 2px; vertical-align: -4px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.bio { font-size: 17px; color: var(--pencil); min-height: 24px; }
.reading { color: var(--faint); font-size: 15px; }
.stickers { display: flex; flex-wrap: wrap; gap: 10px; min-height: 60px; }
.sticker { font: inherit; text-align: left; cursor: pointer; color: var(--ink); background: var(--sticky); border: 2px solid var(--ink); padding: 8px 12px; border-radius: 10px 14px 8px 16px; font-weight: 700; font-size: 16px; transform: rotate(var(--r)) scale(0); animation: pop .35s cubic-bezier(.3,1.6,.6,1) forwards; animation-delay: var(--d); box-shadow: 2px 3px 0 rgba(43,43,43,.2); }
.sticker small { display: block; font-weight: 400; font-size: 13px; color: var(--pencil); }
.sticker b { color: var(--red); font-size: 12px; margin-right: 4px; }
@keyframes pop { to { transform: rotate(var(--r)) scale(1); } }
.stats { display: grid; grid-template-columns: 70px 1fr 44px; gap: 6px 10px; align-items: center; font-size: 15px; font-weight: 700; }
.stats .bar { height: 14px; border: 2px solid var(--ink); border-radius: 8px 6px 9px 5px; background: var(--white); overflow: hidden; }
.stats .bar i { display: block; height: 100%; width: 0; background: var(--c); transition: width .9s cubic-bezier(.2,.8,.2,1); }
.stats span.v { color: var(--pencil); text-align: right; font-weight: 400; }
.flag { background: #ffe1e1; border: 2px solid var(--red); padding: 10px 12px; border-radius: 10px; }
.mine { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.mine a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; border: 2px solid var(--ink); border-radius: 12px 8px 14px 9px; padding: 4px 10px 4px 4px; background: var(--white); font-weight: 700; font-size: 14px; }
.mine img { width: 36px; height: 36px; border-radius: 8px; background: #fff; }
.foot { margin-top: 40px; font-size: 14px; color: var(--pencil); display: flex; gap: 14px; flex-wrap: wrap; }
.foot a { color: var(--pencil); }

/* the Fridge */
.fridge { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; margin-top: 8px; }
.pin { position: relative; text-decoration: none; color: var(--ink); background: var(--white); border: 2px solid var(--ink); border-radius: 6px; padding: 10px 8px 8px; transform: rotate(var(--r)); box-shadow: 3px 4px 0 rgba(43,43,43,.15); transition: transform .12s; }
.pin:hover { transform: rotate(0) translateY(-3px); }
.pin img { width: 100%; aspect-ratio: 1; display: block; background: #fff; }
.pin .magnet { position: absolute; top: -12px; left: 50%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: var(--c); border: 2px solid rgba(0,0,0,.35); box-shadow: inset -4px -3px 0 rgba(0,0,0,.15), 0 2px 0 rgba(0,0,0,.2); }
.pin .nm { font-weight: 700; font-size: 15px; margin-top: 6px; line-height: 1.15; }
.pin .st { font-size: 12px; color: var(--pencil); }
.empty { color: var(--pencil); font-size: 18px; margin: 30px 0; }

/* the doodle page */
.card { display: grid; gap: 16px; }
@media (min-width: 820px) { .card { grid-template-columns: 480px 1fr; align-items: start; } }
.stage { position: relative; width: 100%; aspect-ratio: 1; max-width: 480px; background: var(--white); border: 2.5px solid var(--ink); border-radius: 18px 14px 20px 12px / 14px 20px 12px 18px; overflow: hidden; box-shadow: 4px 5px 0 rgba(43,43,43,.18); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { .sticker { animation-duration: .01s; } .btn { transition: none; } }

.namefield { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-weight: 700; }
.namefield input, .rename input { font: 700 20px "Shantell Sans", cursive; border: none; border-bottom: 2.5px solid var(--ink); background: transparent; padding: 4px 2px; width: min(260px, 60vw); color: var(--ink); outline: none; }
.namefield input:focus, .rename input:focus { border-bottom-color: var(--blue); }
.namefield input::placeholder { color: var(--faint); font-weight: 400; }
.rename { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-height: 24px; }
.linkish { background: none; border: none; padding: 0; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: 700 15px "Shantell Sans", cursive; }
.rename .err { color: var(--red); font-size: 14px; }
.moves { font-size: 14px; color: var(--pencil); min-height: 18px; }
.sticker { border-left: 7px solid var(--el, var(--ink)); }
.sticker .elt { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: var(--el, var(--ink)); border-radius: 8px 5px 9px 6px; padding: 1px 7px; margin-left: 6px; vertical-align: 2px; }
.sticker .kind { font-size: 11px; color: var(--pencil); margin-left: 4px; font-weight: 400; }

/* the loading checklist */
.loading { display: grid; gap: 8px; }
.loading h3 { margin: 0; font-size: 26px; }
.loading h3 .dots::after { content: ''; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.lbar { height: 14px; border: 2.5px solid var(--ink); border-radius: 9px 6px 10px 7px; background: var(--white); overflow: hidden; }
.lbar i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--blue) 0 7px, #5b8ff0 7px 14px); transition: width .45s ease-out; }
.leta { font-size: 13px; color: var(--pencil); }
.lsteps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 7px; }
.lsteps li { display: grid; grid-template-columns: 26px 1fr; align-items: start; column-gap: 6px; }
.lsteps li > div { grid-column: 2; }
.lsteps .lab { font-weight: 700; font-size: 16px; }
.lsteps li.todo .lab { color: var(--faint); }
.lsteps li.now .lab::after { content: ''; animation: dots 1.2s steps(4) infinite; }
.tick { width: 20px; height: 20px; border: 2.5px solid var(--ink); border-radius: 5px 4px 6px 3px; position: relative; background: var(--white); }
.lsteps li.todo .tick { border-color: var(--faint); }
.lsteps li.now .tick { border-color: var(--blue); animation: wig .5s ease-in-out infinite alternate; }
.lsteps li.done .tick::after { content: ''; position: absolute; left: 3px; top: -6px; width: 9px; height: 17px; border: solid var(--green); border-width: 0 4px 4px 0; transform: rotate(40deg); animation: draw .25s ease-out; }
@keyframes wig { to { transform: rotate(-6deg); } } @keyframes draw { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.chips span { font-size: 13px; border: 1.5px solid var(--pencil); border-radius: 10px 6px 11px 7px; padding: 0 7px; background: var(--white); animation: pop .3s cubic-bezier(.3,1.6,.6,1) both; --r: 0deg; }
.lname { font-size: 24px; font-weight: 800; line-height: 1.1; } .lbio, .lmoves, .lvoice, .lbasic { font-size: 14px; color: var(--pencil); }
.lskills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.mini { display: inline-flex; gap: 6px; align-items: center; background: var(--sticky); border: 2px solid var(--ink); border-left: 6px solid var(--el); border-radius: 8px 10px 7px 11px; padding: 3px 8px; font-size: 14px; animation: pop .35s cubic-bezier(.3,1.6,.6,1) both; animation-delay: var(--d); --r: 0deg; }
.mini i { font-style: normal; font-size: 11px; color: #fff; background: var(--el); border-radius: 6px; padding: 0 5px; }
@media (prefers-reduced-motion: reduce) { .chips span, .mini, .tick { animation: none !important; } }

[hidden] { display: none !important; }
