/* Sketchpad (draw.html), parent replay and the Portfolio's stamps. Uses site.css tokens. */
html.sk, html.sk body { height: 100%; width: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; position: fixed; inset: 0; background: var(--kraft); }
.sk-app {
  --pen: #2468d6;
  position: fixed; inset: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh;
  padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  box-sizing: border-box; gap: 6px; font-family: inherit; color: var(--ink);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.sk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; touch-action: manipulation; }
.sk-group { display: flex; gap: 2px; align-items: center; }
.sk-colors { flex-wrap: wrap; }
.sk-btn {
  appearance: none; display: grid; place-items: center; width: 56px; height: 56px; padding: 4px; margin: 0;
  border: 0; border-radius: 16px; background: transparent; color: var(--ink); cursor: pointer; touch-action: manipulation;
}
.sk-btn svg { width: 100%; height: 100%; display: block; }
.sk-btn:focus-visible, .sk-done:focus-visible, .sk-text-btn:focus-visible, .sk-link:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.sk-tool[aria-pressed="true"] { background: var(--paper); box-shadow: inset 0 0 0 3px var(--ink), 0 2px 0 var(--kraft-2); }
.sk-color { width: 46px; }
.sk-swatch { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 2.5px var(--ink); transition: transform .12s ease-out; }
.sk-color[aria-pressed="true"] { background: var(--paper); box-shadow: inset 0 0 0 3px var(--ink); }
.sk-color[aria-pressed="true"] .sk-swatch { transform: scale(1.14); }
.sk-step { width: 52px; }
.sk-step:disabled { opacity: .3; cursor: default; }
.sk-step.is-away { visibility: hidden; }
.sk-done {
  appearance: none; display: inline-flex; align-items: center; gap: 6px; height: 56px; min-width: 104px; padding: 4px 18px 4px 8px; margin-left: auto;
  border: 0; border-radius: 18px; color: #fff; box-shadow: 0 3px 0 #33682a; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 21px; line-height: 1; touch-action: manipulation;
  background: #3a6c2b;
}
.sk-done svg { width: 38px; height: 38px; flex: none; }
.sk-done:active { transform: translateY(2px); box-shadow: 0 1px 0 #33682a; }
.sk-done:disabled { opacity: .6; }
.sk-strip { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.sk-mini { width: 44px; height: 44px; padding: 3px; flex: none; border-radius: 12px; }
.sk-mini[aria-pressed="true"] { background: var(--paper); box-shadow: inset 0 0 0 3px var(--ink); }
.sk-prompt { flex: 1 1 auto; min-width: 0; }
.sk-eyebrow { display: block; font-size: 13px; line-height: 1.2; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-prompt h1 { margin: 0; font-family: inherit; font-weight: 700; font-size: 17px; line-height: 1.25; letter-spacing: 0; color: var(--ink); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.sk-warning { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 14px; border-radius: 12px; background: #fff3d6; box-shadow: inset 0 0 0 2px #9a6a1c; }
.sk-warning[hidden] { display: none; }
.sk-warning p { margin: 0; flex: 1 1 320px; font-size: 16px; line-height: 1.35; color: var(--ink); }
.sk-warning-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sk-text-btn {
  appearance: none; min-height: 44px; padding: 8px 18px; border: 2px solid var(--ink); border-radius: 14px; background: var(--paper); color: var(--ink);
  font-family: inherit; font-weight: 700; font-size: 16px; line-height: 1.1; cursor: pointer; touch-action: manipulation;
}
.sk-text-btn--main { background: var(--ink); color: #fff; min-width: 152px; }
.sk-stage { flex: 1 1 0; min-height: 0; min-width: 0; display: grid; place-items: center; touch-action: none; overflow: hidden; border-radius: 14px; background: var(--kraft-2); padding: 0; }
.sk-stage[hidden], .sk-bar[hidden], .sk-strip[hidden] { display: none; }
.sk-page { position: relative; background: var(--paper); box-shadow: 0 1px 0 rgba(29, 42, 49, .2), 0 6px 16px rgba(29, 42, 49, .18); touch-action: none; overflow: hidden; }
.sk-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sk-live { touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.sk-hint { position: absolute; left: 50%; top: 50%; width: 112px; height: 112px; transform: translate(-50%, -50%); opacity: .75; pointer-events: none; }
.sk-hint[hidden] { display: none; }
.sk-hint svg { width: 100%; height: 100%; }

/* Saved: the picture and its stamp */
.sk-finished { flex: 1 1 0; min-height: 0; display: flex; gap: 20px 28px; align-items: center; justify-content: center; padding: 14px; outline: 0; }
.sk-saved-pic { position: relative; flex: 0 1 auto; min-width: 0; min-height: 0; max-width: min(66vw, 100%); line-height: 0; }
.sk-finished-canvas { display: block; max-width: 100%; max-height: calc(100dvh - 60px); width: auto; height: auto; background: var(--paper); box-shadow: 0 1px 0 rgba(29, 42, 49, .2), 0 10px 24px rgba(29, 42, 49, .2); }
.sk-saved-pic.sk-landing { animation: sk-thud .22s .2s ease-out; }
.sk-saved-pic .did-it-stamp { position: absolute; right: -12px; bottom: -14px; width: clamp(96px, 19%, 168px); height: auto; }
.sk-finished-copy { flex: 0 0 auto; width: min(320px, 100%); }
.sk-finished-copy h2 { margin: 0 0 6px; font-size: 34px; line-height: 1.1; }
.sk-finished-copy p { margin: 0 0 16px; font-size: 18px; line-height: 1.35; }
.sk-finished-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.sk-link {
  appearance: none; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px 18px; box-sizing: border-box; border: 2px solid var(--ink); border-radius: 16px;
  background: var(--paper); color: var(--ink); font-family: inherit; font-weight: 700; font-size: 18px; line-height: 1.15; text-decoration: none; text-align: center; cursor: pointer; touch-action: manipulation;
}
.sk-link--main { background: #3a6c2b; border-color: #3a6c2b; color: #fff; }

/* The stamp lands with one press; reduced motion shows it in place. */
.did-it-stamp { display: block; pointer-events: none; }
.did-it-stamp.sk-landing { animation: sk-stamp-land .26s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes sk-stamp-land { 0% { opacity: 0; transform: scale(1.9) rotate(-5deg); } 62% { opacity: 1; transform: scale(.94) rotate(0); } 100% { opacity: 1; transform: none; } }
@keyframes sk-thud { 30% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { html:root .did-it-stamp.sk-landing, html:root .sk-saved-pic.sk-landing { animation: none; } }
@media (prefers-reduced-motion: reduce) { .did-it-stamp.sk-landing, .sk-saved-pic.sk-landing { animation: none; } .sk-swatch { transition: none; } }

/* Narrow and tall screens */
@media (max-width: 760px) {
  .sk-bar { gap: 4px; justify-content: space-between; }
  .sk-btn { width: 44px; height: 46px; padding: 3px; border-radius: 13px; }
  .sk-color { width: 44px; height: 44px; }
  .sk-swatch { width: 30px; height: 30px; }
  .sk-step { width: 44px; height: 44px; }
  .sk-colors { order: 3; width: 100%; justify-content: space-between; }
  .sk-done { order: 2; height: 46px; min-width: 76px; padding: 2px 10px 2px 4px; font-size: 17px; margin-left: 0; gap: 2px; }
  .sk-done svg { width: 28px; height: 28px; }
  .sk-prompt h1 { font-size: 15px; }
  .sk-eyebrow { font-size: 12px; }
  .sk-finished { flex-direction: column; overflow: auto; justify-content: flex-start; }
  .sk-saved-pic { max-width: 100%; }
  .sk-finished-canvas { max-height: 52dvh; }
  .sk-finished-copy { width: 100%; }
}
@media (max-width: 420px) { .sk-colors { display: grid; grid-template-columns: repeat(5, 44px); justify-content: space-between; } }
@media (max-width: 380px) { .sk-done span { display: none; } .sk-done { min-width: 56px; padding: 2px 8px; justify-content: center; } }
/* A phone on its side: one low row of tools, so the page keeps the height. */
@media (max-height: 480px) and (min-width: 761px) {
  .sk-bar { flex-wrap: nowrap; gap: 4px; }
  .sk-btn { width: 44px; height: 44px; padding: 3px; }
  .sk-color, .sk-step { width: 44px; height: 44px; }
  .sk-swatch { width: 28px; height: 28px; }
  .sk-done { height: 44px; min-width: 56px; padding: 2px 10px 2px 4px; font-size: 16px; }
  .sk-done svg { width: 26px; height: 26px; }
  .sk-eyebrow { display: none; }
  .sk-prompt h1 { font-size: 15px; -webkit-line-clamp: 1; }
  .sk-finished-canvas { max-height: calc(100dvh - 44px); }
}
@media (orientation: portrait) and (min-width: 761px) { .sk-colors { order: 3; width: 100%; } .sk-finished { flex-direction: column; } .sk-saved-pic { max-width: 100%; } .sk-finished-canvas { max-height: 62dvh; } }

/* Parent replay */
.sk-replay { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--kraft); color: var(--ink); overflow: hidden; }
.sk-replay[open] { display: flex; flex-direction: column; }
.sk-replay::backdrop { background: var(--kraft); }
.sk-replay-stage { flex: 1 1 0; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.sk-replay-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); background: var(--paper); }
.sk-replay-bar input[type="range"] { flex: 1 1 200px; min-width: 120px; height: 44px; margin: 0; accent-color: var(--ink); touch-action: pan-y; }

/* Portfolio */
.draw-here { text-decoration: none; }
.draw-here[hidden] { display: none; }
.saved-entry.has-stamp { position: relative; }
.saved-entry .did-it-stamp { position: absolute; top: 10px; right: 12px; width: 124px; height: auto; }
.saved-entry.has-stamp > h3, .saved-entry.has-stamp > h3 + p { padding-right: 136px; }
.saved-entry .saved-picture { display: block; max-width: min(100%, 480px); width: 100%; height: auto; margin: 8px 0; background: var(--paper); box-shadow: 0 0 0 1px var(--rule); }
.saved-prompt { color: var(--ink-2); }
.add-words { display: grid; gap: 8px; margin: 10px 0; }
.add-words label { font-weight: 700; }
.add-words textarea { width: 100%; box-sizing: border-box; min-height: 88px; font: inherit; padding: 8px; }
.unfinished-drawing { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; padding: 12px 14px; border: 2px dashed var(--rule); border-radius: 12px; }
.unfinished-drawing p { margin: 0; flex: 1 1 240px; }
@media (max-width: 460px) {
  .saved-entry .did-it-stamp { width: 78px; }
  .saved-entry.has-stamp > h3, .saved-entry.has-stamp > h3 + p { padding-right: 84px; }
}
