@font-face { font-family: Caveat; src: url(fonts/Caveat.woff) format("woff"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "AbrilFatface-Regular"; src: url(fonts/AbrilFatface-Regular.ttf) format("truetype"); }
@font-face { font-family: "ArchivoBlack-Regular"; src: url(fonts/ArchivoBlack-Regular.woff) format("woff"); }
@font-face { font-family: "BebasNeue-Regular"; src: url(fonts/BebasNeue-Regular.woff) format("woff"); }
@font-face { font-family: "DMSerifDisplay-Regular"; src: url(fonts/DMSerifDisplay-Regular.ttf) format("truetype"); }
@font-face { font-family: "Shrikhand-Regular"; src: url(fonts/Shrikhand-Regular.woff) format("woff"); }
@font-face { font-family: "SpecialElite-Regular"; src: url(fonts/SpecialElite-Regular.woff) format("woff"); }
@font-face { font-family: "PermanentMarker-Regular"; src: url(fonts/PermanentMarker-Regular.woff) format("woff"); }

:root {
  --paper: #F3EDE2;
  --ink: #2B2B2B;
  --muted: #6d655b;
  --line: #ddd3c3;
  --card: #fbf8f2;
  --accent: #B23A48;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; margin: 0 auto; padding: 12px 16px;
}
.logo { font-weight: 600; font-size: 20px; text-decoration: none; letter-spacing: -0.02em; }
.get {
  font-size: 14px; font-weight: 600; text-decoration: none;
  padding: 7px 14px; border-radius: 999px; background: var(--ink); color: #fff;
}

.maker { max-width: 1200px; margin: 0 auto; padding: 0 16px 24px; display: grid; gap: 16px; }
.intro h1 { font-family: Caveat, cursive; font-weight: 700; font-size: 40px; line-height: 1.05; }
.intro p { color: var(--muted); margin-top: 4px; }

.board-wrap { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.board-wrap.dropping canvas { outline: 3px dashed var(--accent); outline-offset: 4px; }
/* Room kept before the script sizes it, so nothing jumps. */
#board { width: min(100%, 358px); aspect-ratio: 9 / 16; height: auto;
  display: block; border-radius: 6px; touch-action: manipulation;
  box-shadow: 0 10px 30px rgba(60, 40, 20, 0.25), 0 1px 3px rgba(0, 0, 0, 0.15);
}
.hint {
  margin-top: 12px; background: #fff; border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px;
  font-size: 14px; text-align: center;
}
.actions { width: 100%; max-width: 440px; display: grid; gap: 8px; margin-top: 14px; }
.actions .wide { width: 100%; }
.actions .row .secondary { flex: 0 0 auto; }
.actions .row .primary { flex: 1; width: auto; }
.credits { font-size: 12px; color: var(--muted); margin-top: 10px; text-align: center; max-width: 520px; }

.controls { display: grid; gap: 14px; align-content: start; }
.group { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.group h2 { font-size: 15px; font-weight: 600; }
.small { font-size: 13px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 13px; cursor: pointer;
  font-family: Caveat, cursive; font-size: 21px; line-height: 1;
}
.chips button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.file input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file span, .primary, .secondary, .note-form button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; padding: 10px 14px; font-weight: 600; cursor: pointer; border: 1px solid var(--ink); text-decoration: none;
}
.file span { background: #fff; width: 100%; }
.file input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--ink); color: #fff; width: 100%; font-size: 17px; }
.primary:disabled { opacity: 0.5; }
.secondary { background: #fff; }
.note-form { display: flex; gap: 8px; }
.note-form input, .title-field input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff;
}
.note-form button { background: #fff; }
.title-field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.title-field input { color: var(--ink); font-size: 16px; }

.on-board ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.on-board li { position: relative; display: flex; align-items: center; }
.on-board img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; display: block; }
.on-board .note { background: #E9E2CF; font-family: Caveat, cursive; font-size: 19px; padding: 2px 10px; border-radius: 3px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.on-board .x {
  position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%;
  border: 0; background: var(--ink); color: #fff; font-size: 14px; line-height: 24px; cursor: pointer;
}

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.papers { display: flex; gap: 8px; }
.papers button {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; background: var(--swatch);
  border: 1px solid rgba(0, 0, 0, 0.2);
}
.papers button[data-paper="grid"] { background-image: linear-gradient(#c9d3dc 1px, transparent 1px), linear-gradient(90deg, #c9d3dc 1px, transparent 1px); background-size: 7px 7px; }
.papers button[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }

.segmented { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.segmented button {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px; cursor: pointer; font-weight: 600;
  display: grid; line-height: 1.2;
}
.segmented small { font-weight: 400; color: var(--muted); font-size: 12px; }
.segmented button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.flash { background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 12px; font-size: 14px; }

.about { max-width: 720px; margin: 0 auto; padding: 24px 16px 40px; }
.about .example { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 6px 24px rgba(60, 40, 20, 0.15); }
.about h2 { font-family: Caveat, cursive; font-size: 32px; margin: 18px 0 8px; }
.about ol { padding-left: 20px; display: grid; gap: 8px; }
.about details { border-top: 1px solid var(--line); padding: 10px 0; }
.about summary { font-weight: 600; cursor: pointer; }
.about details p { margin-top: 6px; color: #4a443d; }
.about p { margin-bottom: 8px; }
.ideas { padding-left: 20px; display: grid; gap: 6px; }
.ideas a { font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 24px; height: 24px; margin: 0; accent-color: var(--ink); }

.after {
  margin: auto; border: 0; border-radius: 18px; padding: 22px; max-width: 360px; width: calc(100% - 32px);
  background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.after::backdrop { background: rgba(31, 27, 24, 0.55); }
.after .saved { font-size: 13px; color: var(--muted); word-break: break-all; }
.after h2 { font-family: Caveat, cursive; font-size: 32px; line-height: 1.1; margin: 6px 0 8px; }
.after ul { margin: 10px 0 16px 20px; display: grid; gap: 4px; }
.after .link { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; }

.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 0 16px 32px; }

/* Phones: areas first, then the board, then the rest. */
@media (max-width: 899px) {
  .controls { display: contents; }
  .intro { order: 0; }
  .g-areas { order: 1; }
  .board-wrap { order: 2; }
  .controls > :not(.g-areas) { order: 3; }
}
@media (min-width: 900px) {
  .board-wrap { position: sticky; top: 12px; align-self: start; }
  .maker { grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "intro intro" "board controls"; column-gap: 32px; }
  .intro { grid-area: intro; }
  .board-wrap { grid-area: board; }
  .controls { grid-area: controls; }
  .intro h1 { font-size: 42px; }
}
