@font-face { font-family: "Pen"; src: url("/assets/fonts/nanum-pen-script-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Mono"; src: url("/assets/fonts/dm-mono-latin-400-normal.woff2") format("woff2"); font-display: swap; }
:root { --ink: #0a0a0a; --paper: #ffffff; --soft: #8a8a8a; --ease: cubic-bezier(.22, 1, .36, 1); }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { font-family: "Pen", "Comic Sans MS", cursive; overflow-x: hidden; }
::selection { background: var(--ink); color: var(--paper); }
img, svg, canvas, video, .stroke { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus:not(:focus-visible), button:focus:not(:focus-visible) { outline: none; }

.sheet { min-height: 100svh; display: grid; place-items: center; align-content: center; gap: 4vh; padding: 6vh 16px 4vh; }
.one { position: relative; width: min(42vw, 30vh, 300px); aspect-ratio: 453 / 754; border: 0; background: none; cursor: pointer; }
.stroke { position: absolute; inset: 0; background: url("/assets/one.png") center / 100% 100% no-repeat; transition: clip-path var(--d) linear; }
/* three strokes of the hand-drawn 1: flag (left to right), stem (top down), base (left to right) */
.s-flag { --d: .32s; clip-path: inset(0 100% 59% 0); }
.s-stem { --d: .62s; clip-path: inset(0 0 100% 36%); transition-delay: .3s; }
.s-base { --d: .34s; clip-path: inset(79% 100% 0 0); transition-delay: .9s; }
.drawn .s-flag { clip-path: inset(0 52% 59% 0); }
.drawn .s-stem { clip-path: inset(0 0 13% 36%); }
.drawn .s-base { clip-path: inset(79% 0 0 0); }
.instant .stroke { transition: none; }

.hint { font-size: 26px; color: var(--soft); transition: opacity .4s var(--ease); }
.hint { font-size: 24px; }

.list { list-style: none; display: grid; gap: 6px; width: min(100%, 360px); }
.list li { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; font-size: clamp(30px, 8vw, 40px); line-height: 1.15;
  opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.list li.on { opacity: 1; transform: none; }
.val { font-family: "Mono", ui-monospace, monospace; font-size: 13px; color: var(--soft); letter-spacing: .02em; }
.box { width: 22px; height: 22px; border: 2.5px solid var(--ink); border-radius: 4px 6px 3px 5px; position: relative; }
.box.x::after { content: ""; position: absolute; left: 3px; top: -4px; width: 9px; height: 16px; border: solid var(--ink); border-width: 0 4px 4px 0; transform: rotate(40deg); border-radius: 2px; }

.tally { min-height: 70svh; display: grid; align-content: center; justify-items: center; gap: 22px; padding: 8vh 16px 6vh; }
.small { font-size: 26px; color: var(--soft); }
.line { width: min(100%, 720px); height: 18px; position: relative; }
.line::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; border-top: 2px dashed #cfcfcf; }
.ink { position: absolute; left: 0; top: 2px; height: 14px; width: 0; background: var(--ink); border-radius: 8px 6px 9px 5px; transition: width 1.6s var(--ease); }
.ends { width: min(100%, 720px); display: flex; justify-content: space-between; font-family: "Mono", monospace; font-size: 13px; color: var(--soft); }
#mc-now { color: var(--ink); }

.chrome { display: grid; justify-items: center; gap: 14px; margin-top: 4vh; width: 100%; }
.ca { display: flex; gap: 10px; align-items: center; max-width: min(100%, 520px); min-width: 0; border: 2.5px solid var(--ink); border-radius: 10px 14px 9px 12px; background: none; padding: 10px 14px; cursor: pointer; color: var(--ink); }
.ca-k { font-size: 24px; }
.ca-v { font-family: "Mono", monospace; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ca.copied .ca-k::after { content: " copied"; }
nav { display: flex; gap: 26px; font-size: 32px; }
nav a { color: var(--ink); text-decoration: none; background: linear-gradient(var(--ink), var(--ink)) 0 92% / 0 3px no-repeat; transition: background-size .35s var(--ease); }
nav a:hover { background-size: 100% 3px; }
.foot { margin-top: 6vh; font-size: 22px; color: var(--soft); }

@media (prefers-reduced-motion: reduce) { .stroke, .list li, .ink { transition: none !important; } }
.word .n { height: .82em; width: auto; vertical-align: -.06em; margin-right: .12em; }
.stamps { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.stamps img { position: absolute; width: auto; opacity: 0; transform: translate(-50%, -50%) rotate(var(--r)) scale(.6); animation: stamp .45s var(--ease) forwards; }
.stamps img.them { filter: opacity(.28); }
@keyframes stamp { to { opacity: 1; transform: translate(-50%, -50%) rotate(var(--r)) scale(1); } }
main { position: relative; z-index: 1; }
.one { touch-action: manipulation; }
.one:active { transform: scale(.985); }
.pop { position: absolute; left: 50%; top: -6%; font-family: "Mono", monospace; font-size: 14px; color: var(--ink); pointer-events: none; animation: pop .7s var(--ease) forwards; }
@keyframes pop { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -28px); } }
@media (prefers-reduced-motion: reduce) { .stamps img { animation: none; opacity: 1; transform: translate(-50%, -50%) rotate(var(--r)); } }
.drawbtn { margin-top: 5vh; font-family: inherit; font-size: 36px; color: var(--paper); background: var(--ink); border: 0; border-radius: 14px 18px 12px 16px; padding: 10px 26px 12px; cursor: pointer; transition: transform .2s var(--ease); }
.drawbtn:active { transform: scale(.97); }
.wall { width: min(100%, 980px); display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-top: 3vh; }
.card { border: 2.5px solid var(--ink); border-radius: 12px 16px 10px 14px; background: var(--paper); padding: 8px 8px 6px; display: grid; gap: 4px; animation: stamp .45s var(--ease) both; --r: 0deg; }
.card svg { width: 100%; aspect-ratio: 1; display: block; }
.card svg polyline { fill: none; stroke: var(--ink); stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.card .cap { font-size: 22px; line-height: 1.1; min-height: 1.1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .row { display: flex; justify-content: space-between; align-items: center; font-family: "Mono", monospace; font-size: 12px; color: var(--soft); }
.card .plus { font-family: "Pen", cursive; font-size: 22px; background: none; border: 2px solid var(--ink); border-radius: 8px; padding: 0 8px; cursor: pointer; color: var(--ink); }
.card .plus.done { background: var(--ink); color: var(--paper); }
.card.mine { outline: 3px dashed var(--ink); outline-offset: 3px; }
.wall-empty { font-size: 24px; color: var(--soft); }
.pad { margin: auto; border: 0; padding: 0; background: transparent; max-width: 100vw; }
.pad::backdrop { background: rgba(255, 255, 255, .86); backdrop-filter: blur(3px); }
.pad-in { width: min(92vw, 440px); background: var(--paper); border: 3px solid var(--ink); border-radius: 18px 22px 16px 20px; padding: 16px; display: grid; gap: 10px; }
.pad-t { font-size: 32px; text-align: center; }
#cv { width: 100%; aspect-ratio: 1; border: 2px dashed #cfcfcf; border-radius: 12px; touch-action: none; cursor: crosshair; background: #fff; }
#cap { font-family: "Pen", cursive; font-size: 26px; border: 0; border-bottom: 2.5px solid var(--ink); padding: 4px 2px; outline: none; background: none; }
.pad-err { font-family: "Mono", monospace; font-size: 12px; color: #c0392b; min-height: 1em; }
.pad-b { display: flex; gap: 10px; justify-content: space-between; }
.pad-b button { font-family: inherit; font-size: 26px; background: none; border: 2.5px solid var(--ink); border-radius: 10px 12px 9px 11px; padding: 2px 12px; cursor: pointer; color: var(--ink); }
.pad-b .post { background: var(--ink); color: var(--paper); }
