/* Foldoodle: the game page. Fonts are served from this site (see fonts/OFL-*.txt for their licences). */
@font-face { font-family: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url("fonts/nunito-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url("fonts/nunito-vietnamese-wght-normal.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url("fonts/nunito-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url("fonts/nunito-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Gaegu"; font-style: normal; font-display: swap; font-weight: 700;
  src: url("fonts/gaegu-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Layout: two worlds. The APP (home, lists, forms) is a calm, plain app: mist ground, white rounded cards, Nunito.
   The DESK (where you draw, and wherever a monster or the snake is shown) is a real wooden kindergarten table seen
   from above: paper taped on a little crooked, real tools lying around, handwritten notes in Gaegu.
   One deliberate light look; there is no separate dark theme. */
:root {
  --ground: #F4F5F8;
  --card: #FFFFFF;
  --ink: #1D1B26;
  --ink-2: #5B5F73;
  --ink-3: #3A3D4D;
  --line: #D5D8E2;
  --tomato: #FF4F38;
  --leaf: #1F7A4F;
  --sun: #FFE46B;
  --scrap: #FDFDFB;
  --fold: #E6E3DA;
  --dash: #A8A397;
  --tape-pink: #FF8FC7;
  --tape-mint: #8FD9B6;
  --wood: #D9A869;
  --wood-shadow: rgba(50, 25, 0, 0.45);
  --soft: 0 2px 10px rgba(29, 27, 38, 0.08);
  --font: "Nunito", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --hand: "Gaegu", "Comic Sans MS", "Chalkboard SE", cursive;
  --bar-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
img, svg, video, canvas { max-width: 100%; }
html { background: var(--ground); }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 16px; font-weight: 400; line-height: 1.4; min-height: 100vh; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--card); }
h1, h2 { font-weight: 900; margin: 0; line-height: 1.1; text-wrap: balance; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.35rem; }
p { margin: 0; }
button, input, select { font-family: inherit; }
button { cursor: pointer; color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.caps { font-size: 0.8rem; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-2); }
.small { font-size: 0.875rem; color: var(--ink-2); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.view { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ---------- app bar ---------- */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: var(--card); box-shadow: 0 2px 10px rgba(29, 27, 38, 0.12);
  min-height: var(--bar-h); display: flex; align-items: center; gap: 10px; padding-block: 8px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { background: none; border: 0; padding: 0; display: flex; align-items: center; min-height: 44px; flex-shrink: 0; }
.brand svg { display: block; width: 150px; height: 39px; }
.brand svg.brand__mark { width: 40px; height: 40px; margin-right: 8px; }
.bar__nav { display: flex; gap: 4px; margin-left: 10px; }
.navlink { background: none; border: 0; border-radius: 999px; color: var(--ink-2); font-size: 0.95rem; font-weight: 700; min-height: 44px; padding: 0 14px; }
.navlink[aria-current="true"] { background: var(--ground); color: var(--ink); font-weight: 900; }
.bar__grow { flex: 1 1 0; min-width: 0; }
.icon { width: 44px; height: 44px; border-radius: 50%; background: var(--ground); border: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; }
.icon:disabled { opacity: 0.45; cursor: default; }
.icon svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#btn-sound[aria-pressed="false"] .wave { display: none; }
#btn-sound[aria-pressed="true"] .mute { display: none; }
.chip { background: var(--ground); border: 0; border-radius: 999px; min-height: 44px; padding: 0 14px; font-size: 0.875rem; font-weight: 700; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 1; }
.bar__turn { display: flex; align-items: center; gap: 12px; min-width: 0; margin-left: 8px; }
.steps { display: flex; gap: 6px; font-size: 0.875rem; font-weight: 700; }
.step { background: var(--ground); color: var(--ink-2); padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
.step--you { background: var(--ink); color: #FFFFFF; }
.turn__title { display: none; font-size: 1.05rem; font-weight: 900; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { font-size: 0.875rem; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.only-draw, .only-phone { display: none; }
body.is-draw .only-draw { display: flex; }
body.is-draw .hide-draw { display: none; }
#btn-submit .short { display: none; }

/* ---------- buttons, cards, messages ---------- */
.btn { background: var(--card); color: var(--ink); border: 2px solid var(--line); border-radius: 999px; font-weight: 900; font-size: 1.05rem; min-height: 48px; padding: 6px 24px; flex-shrink: 0; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn--tomato { background: var(--sun); border-color: var(--ink); color: var(--ink); }      /* the main action: logo yellow with an ink outline, so it still reads as a button on white paper */
.btn--dark { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.btn--small { font-size: 0.95rem; min-height: 44px; padding: 4px 16px; }
.link { background: none; border: 0; color: var(--ink); font-size: 0.9rem; font-weight: 700; text-decoration: underline; min-height: 44px; padding: 0 6px; }
.card { background: var(--card); border-radius: 22px; box-shadow: var(--soft); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.note { background: var(--card); border-radius: 16px; box-shadow: var(--soft); padding: 12px 16px; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.note--bad { background: #FFE3DE; }
.note--good { background: #DDF3E6; color: #124D31; }
.flag { display: inline-flex; align-items: center; font-size: 0.75rem; font-weight: 900; vertical-align: middle; }
.flag img { display: block; width: 27px; height: 18px; border: 1.5px solid var(--ink); }
.rule { background: var(--sun); border-radius: 16px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; font-weight: 700; line-height: 1.25; }
.rule svg { flex-shrink: 0; }

/* ---------- page frame ---------- */
.app { max-width: 720px; margin: 0 auto; padding-block: 22px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 18px; }
.app--wide { max-width: 1100px; }
body.is-draw .app { max-width: none; padding: 0; gap: 0; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: var(--card); box-shadow: 0 -2px 10px rgba(29, 27, 38, 0.08);
  display: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
.tab { background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; font-size: 0.8rem; font-weight: 700; color: var(--ink-2); padding: 0; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: var(--ink-2); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="true"] { color: var(--ink); font-weight: 900; }
.tab[aria-current="true"] svg { stroke: var(--tomato); }

/* ---------- test bar ---------- */
.testbar { background: var(--ink); color: #FFFFFF; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding-block: 6px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); font-size: 0.875rem; }
.testbar .small { color: #C9CBD6; }
.switch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 900; cursor: pointer; }
.switch input { width: 22px; height: 22px; accent-color: var(--tomato); }
.persona { background: #35333F; color: #FFFFFF; border: 0; border-radius: 999px; min-height: 40px; padding: 4px 14px; font-size: 0.85rem; font-weight: 700; }
.persona[aria-pressed="true"] { background: #FFFFFF; color: var(--ink); font-weight: 900; }


/* ---------- desk panels: a piece of the table inside the app ---------- */
.deskpanel { position: relative; border-radius: 22px; overflow: hidden; background: var(--wood) url("img/desk.jpg") center / cover; box-shadow: var(--soft); padding: 26px 20px 22px; }
.scrap { background: var(--scrap); color: var(--ink); font-family: var(--hand); font-weight: 700; box-shadow: 3px 6px 6px rgba(50, 25, 0, 0.4); }
.tape { position: absolute; left: 50%; top: -13px; width: 96px; height: 28px; margin-left: -48px; background: var(--tape-pink); opacity: 0.85; transform: rotate(-3deg); pointer-events: none; z-index: 2; }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.thumbs--big { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 26px 20px; }
.thumb { position: relative; background: var(--scrap); border: 0; padding: 0; display: flex; flex-direction: column; filter: drop-shadow(2px 6px 5px var(--wood-shadow)); min-width: 0; }
.thumb::before { content: ""; position: absolute; left: 50%; top: -8px; width: 44%; height: 16px; margin-left: -22%; background: var(--tape-pink); opacity: 0.85; transform: rotate(-4deg); z-index: 1; }
.thumb:nth-child(3n+2)::before { background: var(--tape-mint); transform: rotate(3deg); }
.thumb:nth-child(4n+1) { transform: rotate(-2deg); } .thumb:nth-child(4n+2) { transform: rotate(1.5deg); }
.thumb:nth-child(4n+3) { transform: rotate(-1deg); } .thumb:nth-child(4n) { transform: rotate(2deg); }
.thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; background: var(--scrap); }
.thumb img + img { border-top: 1px dashed var(--dash); }
.thumb--empty { aspect-ratio: 4 / 9; background: rgba(253, 253, 251, 0.3); filter: none; }
.thumb--empty::before { display: none; }
.mine-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mine-list li { color: var(--ink-3); }
.boxrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.boxrow .btn { margin-left: auto; }
.newchip { background: var(--sun); border-radius: 999px; padding: 1px 10px; font-size: 0.8rem; font-weight: 900; color: var(--ink); }
[data-badge] { position: relative; }
[data-badge]::after { content: attr(data-badge); position: absolute; top: 2px; right: 2px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--tomato); color: var(--ink);
  font-size: 0.75rem; font-weight: 900; line-height: 20px; text-align: center; padding: 0 5px; }
.tab[data-badge]::after { top: 0; right: calc(50% - 32px); }
.tagline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 900; }

/* =====================================================================
   THE DRAWING DESK
   ===================================================================== */
.desk { position: relative; overflow: hidden; background: var(--wood); min-height: calc(100vh - var(--bar-h)); min-height: calc(100dvh - var(--bar-h));
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.desk__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; pointer-events: none; }
.desk__in { position: relative; display: grid; grid-template-columns: 276px minmax(0, 1fr) 252px; gap: 0 22px; align-items: start;
  padding-block: 12px 20px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.desk .note { grid-column: 1 / -1; justify-self: center; margin-bottom: 14px; max-width: 640px; background: var(--tape-pink); border-radius: 0; font-family: var(--hand); font-size: 1.3rem; line-height: 1.15;
  box-shadow: 3px 8px 8px rgba(50, 25, 0, 0.4); transform: rotate(-0.6deg); -webkit-user-select: text; user-select: text; }
.desk .note:not(.note--bad) { background: var(--scrap); }

/* tools: real cut-out pictures lying on the table */
.tools { --th: clamp(150px, calc(50vh - 118px), 318px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 4px; align-content: start; }
.tool { background: transparent; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: calc(var(--th) + 46px); min-width: 0; }
.tool__pic { display: flex; transform: rotate(var(--r)); }
.tool__pic img { display: block; height: calc(var(--th) * var(--k)); width: auto; max-width: none; filter: drop-shadow(4px 6px 4px rgba(50, 25, 0, 0.5)); }
.tool__name { font-family: var(--hand); font-weight: 700; font-size: 1.25rem; line-height: 1.25; background: var(--scrap); padding: 0 8px; transform: rotate(var(--r2)); }
.tool[aria-pressed="true"] .tool__pic { background: var(--scrap); border: 3px solid var(--ink); padding: 10px 16px; box-shadow: 4px 10px 10px var(--wood-shadow); transform: rotate(4deg); }
.tool[aria-pressed="true"] .tool__pic img { height: calc(var(--th) * var(--k) * 0.86); filter: drop-shadow(3px 4px 3px rgba(50, 25, 0, 0.4)); }
.tool[aria-pressed="true"] .tool__name { background: var(--ink); color: var(--scrap); }

/* the sheet of paper. The canvas itself is never rotated; the paper's crooked outline is cut with a clip-path
   and only the tape is turned, so the pen always lands exactly where it points. */
.desk__paper { min-width: 0; padding-top: 22px; }
.sheetwrap { position: relative; width: 100%; max-width: min(600px, calc((100vh - var(--bar-h) - 150px) * 1.3333)); min-width: min(100%, 300px); margin: 0 auto; filter: drop-shadow(3px 12px 10px var(--wood-shadow)); }
.sheet { --paper-c: #FDFDFB; background: var(--paper-c); padding: 10px; clip-path: polygon(0 8px, calc(100% - 7px) 0, 100% calc(100% - 8px), 7px 100%); }
.sheetwrap .tape { left: 46%; top: -12px; width: 120px; height: 34px; margin-left: -60px; }
.tape--side { left: -24px !important; top: 52% !important; width: 60px !important; height: 30px !important; margin: 0 !important; background: var(--tape-mint); opacity: 0.9; transform: rotate(84deg); }
.flap { background: var(--fold); color: var(--ink); min-height: 40px; padding: 6px 14px 4px; font-family: var(--hand); font-weight: 700; font-size: 1.25rem; line-height: 1.15; text-align: right; }
.strip { overflow: hidden; background: var(--scrap); }
.strip img { display: block; width: 100%; height: 100%; max-width: none; }
.sheet--monster .strip { aspect-ratio: 480 / 28.8; border-bottom: 3px dashed var(--dash); }
.sheet--snake .sheet__body { display: grid; grid-template-columns: 7.407% 92.593%; }
.sheet--snake .strip { aspect-ratio: 38.4 / 360; border-right: 3px dashed var(--dash); }
.sheet--nostrip .sheet__body { display: block; }
.stage { position: relative; aspect-ratio: 480 / 360; touch-action: none; overflow: hidden; cursor: crosshair; max-width: 100%; overscroll-behavior: contain; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.nextstrip { position: absolute; pointer-events: none; background: repeating-linear-gradient(-45deg, rgba(128, 128, 128, 0.16) 0 10px, transparent 10px 20px); overflow: visible; }
.nextstrip--bottom { left: 0; right: 0; bottom: 0; height: 8%; border-top: 3px dashed var(--dash); }
.nextstrip--right { top: 0; bottom: 0; right: 0; width: 8%; border-left: 3px dashed var(--dash); }
.nextstrip__tag { position: absolute; right: 10px; bottom: 100%; margin-bottom: 8px; background: var(--sun); color: var(--ink); padding: 1px 12px; font-family: var(--hand); font-weight: 700; font-size: 1.2rem; line-height: 1.25; white-space: nowrap; transform: rotate(-1deg); opacity: 0.94; }
.nextstrip--right .nextstrip__tag { right: 100%; bottom: 8px; margin: 0 8px 0 0; }
.guide { position: absolute; background: var(--tape-pink); pointer-events: none; border-radius: 4px; outline: 1.5px dotted var(--ink); outline-offset: -3px; }
.guide--v { width: 8px; height: 26px; }
.guide--h { height: 8px; width: 26px; }

/* the right-hand side: colours, thickness, paper, the no-writing note */
.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding-top: 8px; }
.colours { padding: 10px 12px; transform: rotate(2deg); }
.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
.swatch { height: 44px; border: 0; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; position: relative; }
.swatch svg { width: 40px; height: 40px; display: block; }
.swatch[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--ink); }
.swatch[aria-pressed="true"] svg { width: 32px; height: 32px; }
.swatch--mix { box-shadow: none; border: 3px dashed var(--ink); cursor: pointer; overflow: hidden; width: 44px; justify-self: center; }
.swatch--mix input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.fat { padding: 6px 12px 8px; transform: rotate(-2deg); display: flex; flex-direction: column; }
.fat__label, .papers__label { font-size: 1.3rem; line-height: 1.2; }
.sizes { display: flex; align-items: center; justify-content: space-between; }
.size { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }
.size[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--ink); }
.size span { border-radius: 50%; background: var(--ink); display: block; }
.papers { display: flex; flex-direction: column; gap: 8px; padding-left: 6px; }
.papers__label { align-self: flex-start; padding: 0 8px; transform: rotate(-2deg); }
.papers__row { display: flex; gap: 10px; padding-bottom: 4px; }
.paperbtn { width: 52px; height: 66px; border: 0; padding: 0; box-shadow: 3px 5px 5px var(--wood-shadow); flex-shrink: 0; }
.paperbtn:nth-child(1) { transform: rotate(-6deg); } .paperbtn:nth-child(2) { transform: rotate(3deg); } .paperbtn:nth-child(3) { transform: rotate(-2deg); } .paperbtn:nth-child(4) { transform: rotate(5deg); }
.paperbtn[aria-pressed="true"] { border: 3px solid var(--ink); translate: 0 -6px; box-shadow: 3px 8px 6px var(--wood-shadow); }
.paperbtn[data-paper="black"][aria-pressed="true"] { border-color: var(--scrap); outline: 2px solid var(--ink); }
.p-smooth { background: #FDFDFB; }
.p-rough { background: #EFECE3 radial-gradient(rgba(29, 27, 38, 0.25) 1px, transparent 1.5px) 0 0 / 6px 6px; }
.p-brown { background: #B98E5E; }
.p-black { background: #24222E; }
.paperask { padding: 8px 12px 10px; font-size: 1.2rem; line-height: 1.15; display: flex; flex-direction: column; gap: 8px; transform: rotate(-1deg); }
.paperask .btn { font-family: var(--font); }
.sticky { background: var(--sun); color: var(--ink); padding: 12px 14px 14px; transform: rotate(2.5deg); box-shadow: 3px 8px 8px rgba(50, 25, 0, 0.4); display: flex; flex-direction: column; gap: 4px; font-family: var(--hand); font-weight: 700; }
.sticky__top { display: flex; align-items: center; gap: 12px; font-size: 1.75rem; line-height: 1; }
.sticky__top svg { flex-shrink: 0; }
.sticky__text { font-size: 1.25rem; line-height: 1.12; }
.hint { padding: 8px 12px; font-size: 1.2rem; line-height: 1.15; transform: rotate(-1.2deg); }
.desklinks { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.desklinks .link { background: var(--scrap); font-family: var(--hand); font-size: 1.15rem; text-decoration: none; padding: 0 10px; min-height: 40px; box-shadow: 2px 4px 4px rgba(50, 25, 0, 0.35); }
.desklinks .link:nth-child(odd) { transform: rotate(-1.5deg); } .desklinks .link:nth-child(even) { transform: rotate(1.5deg); }

/* narrow desk (phones, upright tablets): paper on top, tools poke up from the bottom edge */
@media (max-width: 1039px) {
  .desk__in { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-height: inherit; padding-block: 8px 0; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); }
  .desk .note { order: 0; margin-bottom: 0; align-self: stretch; font-size: 1.15rem; }
  .desk__paper { order: 1; padding-top: 14px; }
  .sheetwrap { max-width: min(640px, calc((100vh - var(--bar-h) - 330px) * 1.3333)); }
  .sheet { padding: 8px; clip-path: polygon(0 6px, calc(100% - 5px) 0, 100% calc(100% - 6px), 5px 100%); }
  .sheetwrap .tape { width: 90px; height: 26px; margin-left: -45px; top: -10px; }
  .tape--side { display: none; }
  .flap { font-size: 1.05rem; min-height: 32px; }
  .nextstrip__tag { font-size: 1rem; }
  .side { display: contents; }
  body.is-draw .steps { display: none; }
  body.is-draw .turn__title { display: block; }
  body.is-draw .bar__turn { flex-direction: column; align-items: flex-start; gap: 0; min-width: 0; }
  .sticky { order: 2; transform: rotate(0.8deg); padding: 6px 12px; flex-direction: row; align-items: center; gap: 10px; box-shadow: 3px 5px 6px rgba(50, 25, 0, 0.4); }
  .sticky__top { font-size: 1.3rem; gap: 10px; }
  .sticky__top svg { width: 52px; height: 30px; }
  .sticky__text { font-size: 1.1rem; line-height: 1.05; }
  .colours { order: 3; transform: rotate(-0.6deg); padding: 6px 8px; display: flex; align-items: center; gap: 6px; margin-inline: -4px; }
  .swatches { display: flex; overflow-x: auto; flex: 1 1 0; min-width: 0; gap: 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
  .swatches::-webkit-scrollbar { display: none; }
  .swatch { width: 44px; flex-shrink: 0; }
  .only-phone { display: flex; }
  .fat { display: none; }
  .papers { order: 4; display: none; padding-left: 0; flex-direction: row; align-items: center; gap: 12px; }
  .papers.is-open { display: flex; }
  .paperbtn { width: 44px; height: 54px; }
  .paperask { order: 5; }
  .hint { order: 6; font-size: 1.05rem; transform: rotate(-0.5deg); padding: 6px 10px; }
  .desklinks { order: 7; }
  .tools { order: 9; display: flex; justify-content: space-between; align-items: flex-start; height: 112px; margin: auto -8px 0; padding-top: 16px; flex-shrink: 0; }
  .tool { width: 60px; height: 132px; justify-content: flex-start; flex-shrink: 1; }
  .tool__pic { transform-origin: 50% 0; }
  .tool__pic img { height: var(--ph); filter: drop-shadow(3px 4px 3px rgba(50, 25, 0, 0.5)); }
  .tool__name { display: none; }
  .tool[aria-pressed="true"] { transform: translateY(-14px); }
  .tool[aria-pressed="true"] .tool__pic { padding: 8px 12px 0; border-bottom: 0; transform: rotate(2deg); box-shadow: 3px 6px 6px rgba(50, 25, 0, 0.4); height: 136px; overflow: hidden; }
  .tool[aria-pressed="true"] .tool__pic img { height: calc(var(--ph) * 0.8); }
  .sizecycle { width: 44px; height: 44px; border: 0; background: var(--ground); border-radius: 50%; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; }
  .sizecycle span { border-radius: 50%; background: var(--ink); display: block; }
  .paperopen { width: 36px; height: 44px; border: 2px solid var(--ink); transform: rotate(4deg); flex-shrink: 0; padding: 0; margin-right: 4px; }
}
@media (max-width: 759px) {
  :root { --bar-h: 56px; }
  .bar { gap: 8px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .bar__nav { display: none; }
  .brand svg { width: 112px; height: 29px; }
  .brand svg.brand__mark { width: 34px; height: 34px; margin-right: 6px; }
  .tabbar { display: grid; }
  body.is-draw .tabbar { display: none; }
  .app { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  body.is-draw .app { padding-bottom: 0; }
  body.is-draw .brand, body.is-draw #btn-redo, .steps { display: none; }
  .bar__turn { flex-direction: column; align-items: flex-start; gap: 0; margin-left: 0; flex: 1 1 0; }
  .turn__title { display: block; max-width: 100%; font-size: 0.92rem; }
  .icon { width: 40px; height: 40px; }
  #test-help { display: none; }
  .testbar { flex-wrap: nowrap; overflow-x: auto; }
  .testbar .row { flex-wrap: nowrap; }
  .persona, .switch { white-space: nowrap; }
  body.is-draw .bar__grow { display: none; }
  body.is-draw .back { display: flex; }
  #btn-submit { font-size: 0.95rem; min-height: 44px; padding: 0 14px; }
  #btn-submit .long { display: none; } #btn-submit .short { display: inline; }
  .thumbs { gap: 12px 10px; }
  .deskpanel { padding: 24px 14px 18px; }
}
.back { display: none; }

/* ---------- checking ---------- */
.checkrow { display: flex; align-items: center; gap: 12px; font-size: 1.05rem; font-weight: 700; }
.checkrow svg { flex-shrink: 0; }
.checkrow .ring { animation: spin 2.4s linear infinite; transform-origin: 14px 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .checkrow .ring { animation: none; } }

/* ---------- reveal ---------- */
.reveal { display: flex; gap: 22px; align-items: stretch; justify-content: center; padding: 30px 18px 24px; }
.reveal__paper { position: relative; flex: 0 0 56%; max-width: clamp(190px, calc((100vh - 250px) * 0.4444), 340px); background: var(--scrap); transform: rotate(-1.2deg); filter: drop-shadow(3px 10px 8px var(--wood-shadow)); display: flex; flex-direction: column; min-width: 0; align-self: flex-start; }
.reveal__paper img { display: block; width: 100%; aspect-ratio: 4 / 3; }
.reveal__paper img + img { border-top: 2px dashed var(--dash); }
.reveal__tags { display: flex; flex-direction: column; justify-content: space-around; gap: 14px; flex: 1; min-width: 0; max-width: 300px; }
.nametag { flex: 0 0 auto; padding: 10px 14px 12px; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
.nametag:nth-child(1) { transform: rotate(1.5deg); } .nametag:nth-child(2) { transform: rotate(-1deg); } .nametag:nth-child(3) { transform: rotate(1deg); }
.nametag--you { background: var(--sun); }
.nametag__part { font-size: 1.1rem; line-height: 1.1; color: var(--ink-2); }
.nametag__name { font-size: 1.6rem; line-height: 1.02; overflow-wrap: anywhere; }
.nametag__from { font-size: 1.15rem; line-height: 1.1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.reveal__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.reveal__actions .btn { flex: 1 1 140px; }
.reveal__move { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.reveal__fold { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--dash); pointer-events: none; z-index: 1; }

/* ---------- snake ---------- */
.snake__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.yours { font-size: 2.1rem; line-height: 1; }
.scrub { background: var(--card); border-radius: 999px; box-shadow: var(--soft); padding: 0 18px; display: flex; align-items: center; gap: 14px; min-height: 56px; font-weight: 900; font-size: 0.875rem; }
.scrub input { flex: 1; min-width: 0; height: 44px; accent-color: var(--tomato); }

/* ---------- overlays: name tag, first-time hint, picture ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; overflow: auto; display: flex; justify-content: center; align-items: flex-start; background: var(--ground);
  padding: calc(24px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.overlay--dim { background: rgba(29, 27, 38, 0.55); align-items: center; }
.join { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.join__logo { display: flex; align-items: center; justify-content: center; gap: 6px; }
.join__logo svg { display: block; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 0.875rem; font-weight: 900; color: var(--ink-3); }
.field input, .field select { height: 52px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font-size: 1.1rem; font-weight: 700; padding: 0 12px; width: 100%; min-width: 0; }
.field input:focus-visible, .field select:focus-visible { border-color: var(--ink); outline-offset: 0; }
.field--age { width: 96px; flex-shrink: 0; }
.howto { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.howto li { display: flex; gap: 12px; align-items: center; font-weight: 700; line-height: 1.3; }
.howto svg { flex-shrink: 0; }
.shot { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 12px; box-shadow: var(--soft); }
.metag { display: flex; align-items: center; gap: 14px; }
.metag__name { font-size: 1.5rem; font-weight: 900; line-height: 1.1; overflow-wrap: anywhere; }

/* =====================================================================
   Things that were inline styles in the prototype (the site's security policy allows no inline styles)
   ===================================================================== */
.defs { position: absolute; }
.ov { overflow: visible; }
.leaf { color: var(--leaf); }
.center { text-align: center; }
.row--g6 { gap: 6px; } .row--g8 { gap: 8px; }
.row--center { justify-content: center; }
.row--form { flex-wrap: nowrap; align-items: flex-end; }
.field--grow { flex: 1; }
.view--g4 { gap: 4px; } .view--g8 { gap: 8px; } .view--g10 { gap: 10px; }
.join--wide { max-width: 520px; }
.mixplus { width: 18px; height: 18px; }
.tool[data-tool="pencil"] { --k: 1; --ph: 420px; --r: -5deg; --r2: -3deg; }
.tool[data-tool="crayon"] { --k: 0.98; --ph: 400px; --r: 3deg; --r2: 2deg; }
.tool[data-tool="marker"] { --k: 0.91; --ph: 350px; --r: -3deg; --r2: -1deg; }
.tool[data-tool="brush"] { --k: 1.02; --ph: 430px; --r: 6deg; --r2: 2deg; }
.tool[data-tool="smudge"] { --k: 0.92; --ph: 380px; --r: -7deg; --r2: -2deg; }
.tool[data-tool="eraser"] { --k: 0.55; --ph: 170px; --r: 9deg; --r2: 3deg; }
.overlay .card.join { gap: 14px; }

/* =====================================================================
   New with the real site: links, monster ticket, bring-my-monsters, add to home screen, plain pages
   ===================================================================== */
a { color: var(--ink); font-weight: 700; }
.small a { color: var(--ink-3); }
.noscript { max-width: 30rem; margin: 3rem auto; padding: 0 1rem; font-weight: 700; }
.testbar__input { height: 40px; width: 12rem; max-width: 46vw; border: 0; border-radius: 999px; padding: 0 14px; font-size: 0.9rem; background: #FFFFFF; color: var(--ink); }
.testbar form { margin: 0; }
.switch--plain { font-weight: 700; font-size: 0.95rem; }

.ticket { display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: center; }
.ticket__qr { width: 196px; height: 196px; flex-shrink: 0; background: #FFFFFF; border: 2px solid var(--line); border-radius: 12px; image-rendering: pixelated; margin: 0 auto; }
.ticket__how { flex: 1 1 200px; display: flex; flex-direction: column; gap: 10px; font-size: 0.95rem; }
#ticket-link { font-size: 0.85rem; font-weight: 400; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-overflow: ellipsis; }
.rule--warn { background: #FFE3DE; align-items: flex-start; }

.install__head { display: flex; align-items: center; gap: 14px; }
.install__head img { border-radius: 14px; box-shadow: var(--soft); flex-shrink: 0; }
.install__steps { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 8px; font-weight: 700; }
.install__steps svg { width: 20px; height: 20px; vertical-align: -4px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* privacy.html and other plain reading pages */
.doc { max-width: 720px; margin: 0 auto; padding: 28px max(18px, env(safe-area-inset-right, 0px)) 60px max(18px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 16px; line-height: 1.5; }
.doc h1 { font-size: 1.9rem; } .doc h2 { margin-top: 14px; }
.doc ul { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.doc table { border-collapse: collapse; width: 100%; background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: var(--soft); font-size: 0.95rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 900; background: var(--ground); }
.doc tr:last-child td { border-bottom: 0; }
.doc__brand { display: inline-flex; }
.doc__brand svg { display: block; width: 170px; height: 40px; }
.draft { background: var(--sun); border-radius: 16px; padding: 12px 14px; font-weight: 700; }
#btn-submit { align-items: center; justify-content: center; }

/* =====================================================================
   HOME: the page is the wooden desk, with things lying on it. Only while Home is shown (body.is-home):
   no grey ground, no white cards, and the solid top bar turns into loose pieces (logo scrap, nav pill, name tag).
   Rotations are decoration only; the desk clips sideways so a turned paper can never make the page scroll.
   ===================================================================== */
body.is-home { background: var(--wood) url("img/desk.jpg") center top / cover; }
body.is-home::before { background: transparent; }
.chip__sub { display: none; }

/* the top pieces */
body.is-home .bar { position: relative; top: auto; background: transparent; box-shadow: none; max-width: 1368px; margin: 0 auto; align-items: flex-start; gap: 10px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px)); padding-bottom: 8px; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); }
body.is-home .bar { pointer-events: none; }      /* the bar itself is see-through: taps go to what lies under it (the mailbox note) */
body.is-home .bar > * { pointer-events: auto; }
body.is-home .brand { order: 0; background: var(--scrap); padding: 6px 14px 6px 8px; min-height: 52px; transform: rotate(-2deg); box-shadow: 3px 6px 6px rgba(50, 25, 0, 0.4); }
body.is-home .bar__grow { order: 1; }
body.is-home .bar__nav { order: 2; margin-left: 0; background: var(--card); border-radius: 999px; padding: 6px; box-shadow: 2px 6px 10px rgba(50, 25, 0, 0.35); }
body.is-home .navlink { color: var(--ink); }
body.is-home .navlink[aria-current="true"] { background: var(--ink); color: #FFFFFF; }
body.is-home #btn-sound { order: 3; background: var(--card); box-shadow: 2px 5px 8px rgba(50, 25, 0, 0.35); margin-top: 4px; }
body.is-home .chip { order: 4; background: var(--scrap); border-radius: 0; border-top: 9px solid var(--tomato); min-height: 52px; padding: 4px 12px 6px; max-width: none; min-width: 0; flex: 0 1 auto;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; text-align: left; transform: rotate(2deg); box-shadow: 3px 6px 6px rgba(50, 25, 0, 0.4); }
body.is-home .chip__name { font-size: 0.9rem; font-weight: 900; line-height: 1.12; max-width: 100%; white-space: normal; overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
body.is-home .navlink[data-badge]::after { top: -7px; right: -5px; }
body.is-home .chip__sub { display: block; font-size: 0.75rem; font-weight: 700; color: var(--ink-2); line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
body.is-home .chip__sub:empty, body.is-home .chip__age { display: none; }

/* the desk */
body.is-home .app { max-width: none; padding-top: 14px; overflow-x: clip; }
.home { position: relative; gap: 22px; width: 100%; max-width: 1288px; margin: 0 auto; }
.home h1, .home h2, .home p, .home ol { margin: 0; }
.deco { position: absolute; max-width: none; pointer-events: none; -webkit-user-select: none; user-select: none; filter: drop-shadow(3px 6px 4px rgba(50, 25, 0, 0.5)); }
.herowrap { position: relative; margin: 6px 6px 0; }
.deco--crayon { height: 300px; left: -34px; bottom: -150px; transform: rotate(38deg); }
.hero { position: relative; background: var(--scrap); padding: 30px 22px 20px; transform: rotate(-2deg); box-shadow: 4px 12px 14px var(--wood-shadow); display: flex; flex-direction: column; gap: 16px; }
.hero__tape { position: absolute; left: 38%; top: -14px; width: 104px; height: 30px; background: var(--tape-pink); opacity: 0.88; transform: rotate(-4deg); }
.hero h1 { font-size: clamp(1.55rem, 6.4vw, 2.3rem); line-height: 1.08; }
.hero__how { display: flex; align-items: center; gap: 16px; }
.foldstrip { width: 42%; max-width: 190px; height: auto; flex-shrink: 0; transform: rotate(-1.5deg); }
.foldstrip__you { font-family: var(--hand); font-weight: 700; font-size: 26px; fill: var(--ink); }
.hero__steps { list-style: none; padding: 0; display: flex; flex-direction: column; justify-content: space-around; align-self: stretch; gap: 10px; font-family: var(--hand); font-weight: 700; font-size: 1.3rem; line-height: 1.15; color: var(--ink); }
.hero__you { color: #D8321C; }
.hero__go { width: 100%; min-height: 64px; font-size: 1.3rem; }
.hero__status { font-size: 0.9rem; font-weight: 700; color: var(--ink-2); padding-left: 4px; min-height: 1.4em; cursor: default; }      /* plain information, not a link; keeps its room while empty so nothing jumps */

/* notes lying on the desk: mailbox (yellow), and the small white ones */
.home__notes { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.home__notes:not(:has(> :not([hidden]))) { display: none; }
.mailbox { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; max-width: 100%; }
.mailnote { position: relative; background: var(--sun); border: 0; min-height: 64px; padding: 12px 26px 12px 16px; text-align: left; display: flex; flex-direction: column; gap: 2px; transform: rotate(2deg); box-shadow: 3px 8px 8px rgba(50, 25, 0, 0.4); }
.mailnote__dot { position: absolute; right: -7px; top: -7px; width: 20px; height: 20px; border-radius: 50%; background: var(--tomato); }
.mailnote__title { font-family: var(--hand); font-weight: 700; font-size: 1.4rem; line-height: 1.1; }
.mailnote__go { font-weight: 900; font-size: 0.95rem; }
.mailbox__list { background: var(--scrap); padding: 12px 14px; box-shadow: 3px 6px 6px rgba(50, 25, 0, 0.4); align-self: stretch; }
.home .note, body.is-home #banner { background: var(--scrap); border-radius: 0; box-shadow: 3px 6px 6px rgba(50, 25, 0, 0.4); max-width: 34rem; }
.home .note.note--bad { background: #FFE3DE; }
.home .note.note--good { background: #DDF3E6; }
#home-pending { transform: rotate(-1deg); } #home-resume { transform: rotate(1deg); }

/* the snake: a long paper strip running off both edges of the desk */
.home__snake { display: flex; flex-direction: column; gap: 18px; }
.snakepaper { display: block; border: 0; padding: 0; background: var(--scrap); width: calc(100vw + 48px); max-width: none; margin-left: calc(50% - 50vw - 24px); height: 92px; transform: rotate(-1.5deg); box-shadow: 0 8px 8px rgba(70, 35, 5, 0.35); overflow: hidden; }
.snakepaper:focus-visible { outline-offset: -5px; }
.snakepaper__in { display: flex; justify-content: center; height: 100%; }
.snakepaper__art { display: block; width: 100%; height: 100%; }
.snakepaper__piece { flex: 0 0 auto; height: 100%; aspect-ratio: 4 / 3; border-left: 2px dashed var(--dash); background: var(--scrap); }
.snakepaper__piece img { display: block; width: 100%; height: 100%; max-width: none; }
.snakepaper__piece--next { background: repeating-linear-gradient(-45deg, rgba(128, 128, 128, 0.14) 0 10px, transparent 10px 20px); }
.home__snakebar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.snakelabel { background: var(--scrap); padding: 8px 14px 9px; transform: rotate(-1deg); box-shadow: 3px 6px 6px rgba(50, 25, 0, 0.4); min-width: 0; }
.snakelabel h2 { font-size: 1.2rem; }
.snakelabel p { font-size: 0.85rem; font-weight: 700; color: var(--ink-2); min-height: 1.2em; }
.home__snakebar .btn { min-height: 56px; box-shadow: 2px 6px 8px rgba(50, 25, 0, 0.4); }

/* fresh from the fold: snapshots lying on the desk */
.home__fresh { display: flex; flex-direction: column; gap: 14px; }
.home__freshhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.handlabel, .handnote, .handlink { background: var(--scrap); font-family: var(--hand); font-weight: 700; box-shadow: 3px 6px 6px rgba(50, 25, 0, 0.4); }
h2.handlabel { font-size: clamp(1.2rem, 5.6vw, 1.45rem); line-height: 1.2; padding: 3px 12px; transform: rotate(-1.5deg); white-space: nowrap; }
.handlink { font-size: 1.1rem; padding: 0 10px; text-decoration: underline; transform: rotate(1.5deg); white-space: nowrap; flex-shrink: 0; }
.handnote { align-self: flex-start; font-size: 1.25rem; line-height: 1.15; padding: 8px 14px; max-width: 24rem; transform: rotate(-1deg); }
.snaps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.snap { background: var(--scrap); border: 0; padding: 7px 7px 6px; display: flex; flex-direction: column; gap: 5px; min-width: 0; box-shadow: 3px 8px 9px var(--wood-shadow); }
.snap:nth-child(4n+1) { transform: rotate(-3deg); } .snap:nth-child(4n+2) { transform: rotate(2deg); } .snap:nth-child(4n+3) { transform: rotate(-1.5deg); } .snap:nth-child(4n) { transform: rotate(3deg); }
.snap:nth-child(4) { display: none; }
.snap__pic { display: block; }
.snap__pic img { display: block; width: 100%; aspect-ratio: 4 / 3; background: var(--scrap); }
.snap__pic img + img { border-top: 1px dashed var(--dash); }
.snap__names { font-family: var(--hand); font-weight: 700; font-size: 1rem; line-height: 1.1; text-align: center; color: var(--ink-3); overflow-wrap: anywhere; min-height: 2.2em; display: flex; align-items: center; justify-content: center; }

/* the foot of the desk */
.insta { display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; margin-top: 14px; padding: 10px 16px 10px 12px; min-height: 48px; background: var(--scrap); color: var(--ink); text-decoration: none; box-shadow: 3px 6px 6px rgba(50, 25, 0, 0.4); transform: rotate(-1.5deg); }
.insta__logo { width: 34px; height: 34px; flex-shrink: 0; fill: none; stroke: var(--ink); stroke-width: 2.2; }
.insta__dot { fill: var(--ink); stroke: none; }
.insta__text { display: flex; flex-direction: column; line-height: 1.2; }
.insta__text strong { font-weight: 900; font-size: 0.98rem; }
.insta__handle { font-family: var(--hand); font-weight: 700; font-size: 1.15rem; text-decoration: underline; }
.home__foot { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; position: relative; }
.rulenote { background: var(--sun); font-family: var(--hand); font-weight: 700; font-size: 1.3rem; line-height: 1.1; padding: 8px 16px 8px 12px; display: flex; align-items: center; gap: 10px; transform: rotate(-2deg); box-shadow: 3px 6px 6px rgba(50, 25, 0, 0.4); }
.rulewrap { position: relative; }
.parents { background: var(--scrap); font-size: 0.85rem; color: var(--ink-3); padding: 10px 14px; max-width: 34rem; transform: rotate(0.6deg); box-shadow: 3px 6px 6px rgba(50, 25, 0, 0.4); }
.deco--small { height: 270px; left: calc(100% + 132px); top: calc(50% - 128px); transform: rotate(-82deg); }      /* lies to the right of the yellow note, tip first, running off the desk */
.deco--wide { display: none; }
.home__snakebar { position: relative; }

/* roomy screens: the mailbox note lies up between the logo and the navigation, as on a real desk */
@media (min-width: 1280px) {
  .mailbox { position: absolute; left: 400px; top: -104px; z-index: 3; align-items: flex-start; }
  body:has(#testbar:not([hidden])) .mailbox { position: static; }      /* the owner's test bar sits in that spot */
  .mailbox__list { min-width: 26rem; }
}

@media (min-width: 1360px) { .deco--wide.deco--pencil { display: block; } }      /* only where there is free wood for it */

/* browsers that cannot clip sideways (old Safari): the strip stays inside the page instead of running off it */
@supports not (overflow-x: clip) { .snakepaper { width: 100% !important; margin-left: 0 !important; } }

/* a tiny wobble under the finger or the mouse, for people who do not mind motion */
@media (prefers-reduced-motion: no-preference) {
  .snap, .mailnote, .snakepaper { transition: translate 0.15s ease, rotate 0.15s ease; }
  .snap:hover, .mailnote:hover { rotate: 1.5deg; translate: 0 -2px; }
  .snap:active, .mailnote:active { rotate: -1deg; }
  .snakepaper:hover { translate: 0 -2px; }
}

/* phone: the tab bar floats over the desk */
@media (max-width: 759px) {
  body.is-home .tabbar { left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); border-radius: 32px; padding: 6px 8px; box-shadow: 0 6px 16px rgba(50, 25, 0, 0.4); }
  body.is-home .app { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
  body.is-home .brand { padding: 6px 10px 6px 7px; }
  body.is-home .brand svg { width: 96px; height: 25px; }
  body.is-home .brand svg.brand__mark { width: 34px; height: 34px; }
  body.is-home .chip { max-width: 38vw; padding: 3px 10px 5px; }
  body.is-home #btn-sound { width: 44px; height: 44px; }
}
@media (min-width: 600px) {
  .snaps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .snap:nth-child(4) { display: flex; }
  .snakepaper { height: 112px; }
  .herowrap { max-width: 560px; align-self: center; width: 100%; }
  .home__notes { align-items: center; }
  .home__snakebar { justify-content: center; gap: 24px; }
}
/* wide: paper left, notes and snapshots right, the snake along the bottom */
@media (min-width: 1200px) {
  body.is-home .bar { padding-left: 40px; padding-right: 40px; padding-top: 28px; gap: 16px; }
  body.is-home .brand { padding: 8px 20px 8px 10px; }
  body.is-home .brand svg { width: 190px; height: 49px; }
  body.is-home .brand svg.brand__mark { width: 58px; height: 58px; margin-right: 12px; }
  body.is-home .chip { margin-left: 14px; padding: 6px 16px 8px; }
  body.is-home .chip__name { font-size: 1rem; }
  body.is-home .chip__sub { font-size: 0.8rem; }
  body.is-home .app { padding-left: 40px; padding-right: 40px; padding-bottom: 28px; }
  .home { --hpad: clamp(40px, 6.6vw, 96px); display: grid; grid-template-columns: minmax(0, 500px) minmax(0, 1fr); grid-template-rows: auto auto 1fr auto auto; column-gap: var(--hpad); row-gap: 20px; padding-left: var(--hpad); }
  .herowrap { grid-column: 1; grid-row: 1 / 4; margin: 10px 0 0; align-self: start; max-width: none; }
  .hero { padding: 44px 40px 28px; gap: 22px; }
  .hero h1 { font-size: 2.45rem; }
  .hero__steps { font-size: 1.6rem; }
  .deco--crayon { height: 380px; left: -110px; bottom: -150px; }
  .home__notes { grid-column: 2; grid-row: 1; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .home__fresh { grid-column: 2; grid-row: 2; }
  .home__snake { display: contents; }
  .home__snakebar { grid-column: 2; grid-row: 3; align-self: end; justify-content: flex-end; gap: 22px; padding-bottom: 6px; }
  .snakelabel { padding: 10px 18px 12px; }
  .snakelabel h2 { font-size: 1.45rem; }
  .snakelabel p { font-size: 0.95rem; }
  .snakepaper { grid-column: 1 / -1; grid-row: 4; height: 128px; margin-left: calc(50% - 50vw - 24px - var(--hpad) / 2); margin-top: 6px; }
  .home__foot { grid-column: 1 / -1; grid-row: 5; flex-direction: row; align-items: flex-start; gap: 28px; margin-left: calc(-1 * var(--hpad)); }
  .rulewrap { margin-top: -44px; z-index: 1; }
  .deco--small { display: none; }
  .deco--wide { display: block; }
  .deco--wide.deco--pencil { display: none; height: 236px; right: calc(100% - 84px); top: -92px; transform: rotate(-66deg); }      /* on the free wood left of the snake label */
  .deco--wide.deco--eraser { height: 104px; right: 18px; bottom: calc(100% + 16px); transform: rotate(16deg); }
}

/* =====================================================================
   LANGUAGE SWITCH (EN / NL): two real buttons, the current one marked. On Home it is a paper scrap among the top
   pieces; on Me it sits in its own card. Other views do not show it.
   ===================================================================== */
.langsw { display: inline-flex; gap: 2px; padding: 3px; background: var(--ground); border-radius: 999px; flex-shrink: 0; }
.langsw__b { min-width: 44px; min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 0.9rem; font-weight: 900; padding: 0 10px; }
.langsw__b[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; }
.langsw__b:disabled { opacity: 0.45; cursor: default; }
.langsw--bar { display: none; }
body.is-home .langsw--bar { display: inline-flex; order: 3; background: var(--scrap); border-radius: 0; padding: 3px; transform: rotate(-1.5deg); box-shadow: 3px 6px 6px rgba(50, 25, 0, 0.4); }
body.is-home .langsw--bar .langsw__b { border-radius: 0; color: var(--ink); }
body.is-home .langsw--bar .langsw__b[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; }
.card--row { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
@media (max-width: 759px) {
  /* phone: the top pieces take two rows; the switch lies under the name tag */
  body.is-home .bar { flex-wrap: wrap; row-gap: 8px; }
  body.is-home .langsw--bar { order: 5; margin-left: auto; }
}

/* the plain reading pages (about/, nl/over/): same look as the parents' page */
.doc .lead { font-size: 1.12rem; font-weight: 700; }
.doc ol { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 6px; }
.doc__play { display: inline-flex; align-items: center; min-height: 48px; padding: 6px 24px; border-radius: 999px; background: var(--tomato); color: var(--ink); font-weight: 900; text-decoration: none; }
.doc__foot { margin-top: 18px; padding-top: 14px; border-top: 2px solid var(--line); font-size: 0.9rem; line-height: 2; display: flex; flex-direction: column; gap: 4px; }
.doc__foot a[aria-current="page"] { text-decoration: none; }
.doc th, .doc td { overflow-wrap: anywhere; hyphens: auto; }      /* long words (Dutch has many) must not push the table off a phone screen */

/* =====================================================================
   REPORT A BUG: a short form in a dialog, with a small "are you a person" step in the game's own style
   ===================================================================== */
.bug__fields { display: flex; flex-direction: column; gap: 12px; }
.field textarea { border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; font-size: 1.05rem; padding: 10px 12px; width: 100%; min-width: 0; resize: vertical; min-height: 110px; }
.field textarea:focus-visible { border-color: var(--ink); outline-offset: 0; }
.bug__count { align-self: flex-end; font-variant-numeric: tabular-nums; }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }      /* a field no person sees or reaches; robots fill it in */
.human { border: 2px dashed var(--line); border-radius: 16px; margin: 0; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.human legend { font-size: 0.875rem; font-weight: 900; color: var(--ink-3); padding: 0 6px; }
.human__track { --x: 0; --t: 0.8; position: relative; height: 56px; border-radius: 12px; background: var(--wood) url("img/desk.jpg") center / cover; touch-action: none; -webkit-user-select: none; user-select: none; }
.human__goal { position: absolute; top: 6px; left: calc(var(--t) * (100% - 84px) + 20px); width: 44px; height: 44px; }
.human__goal svg { display: block; width: 100%; height: 100%; }
.human__handle { position: absolute; top: 0; left: calc(var(--x) * (100% - 84px)); width: 84px; height: 56px; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; }
.human__handle img { height: 78px; width: auto; max-width: none; transform: rotate(90deg); pointer-events: none; filter: drop-shadow(-3px 3px 3px rgba(50, 25, 0, 0.5)); }
.human__handle.is-dragging { cursor: grabbing; }
.human__track.is-done .human__handle { cursor: default; }
.human__picks { display: flex; flex-wrap: wrap; gap: 8px; }
.human__pick { width: 52px; height: 64px; border: 2px solid var(--line); border-radius: 12px; background: var(--scrap); padding: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.human__pick img { height: 54px; width: auto; max-width: none; pointer-events: none; }
.human__pick[aria-pressed="true"] { border-color: var(--leaf); box-shadow: inset 0 0 0 2px var(--leaf); }
.human__ok { background: #DDF3E6; color: #124D31; border-radius: 12px; padding: 8px 12px; font-weight: 700; margin: 0; }

/* the first step of "tell us something": three big choices */
.kinds { display: flex; flex-direction: column; gap: 10px; }
.kind { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 16px; border: 2px solid var(--line); border-radius: 18px; background: var(--card); font-size: 1.1rem; font-weight: 900; text-align: left; }
.kind svg { width: 44px; height: 44px; flex-shrink: 0; }
.kind:hover { border-color: var(--ink); }
.bug__back { align-self: flex-start; padding-left: 0; }
.doc__foot a { white-space: nowrap; }      /* a link never breaks over two lines, so it stays easy to tap */

/* =====================================================================
   SNAKE PIECES ON THE DRAWING DESK: the strip of the piece before lies on the side where the body comes in
   (left, right or top); the hatched strip for the next player on the side where it leaves.
   ===================================================================== */
.sheet--snake.sheet--in-right .sheet__body { grid-template-columns: 92.593% 7.407%; }
.sheet--snake.sheet--in-right .strip { order: 2; border-right: 0; border-left: 3px dashed var(--dash); }
.sheet--snake.sheet--in-top .sheet__body { display: block; }
.sheet--snake.sheet--in-top .strip { aspect-ratio: 480 / 28.8; border-right: 0; border-bottom: 3px dashed var(--dash); }
.nextstrip--left { top: 0; bottom: 0; left: 0; width: 8%; border-right: 3px dashed var(--dash); }
.hint .shape { display: block; float: left; width: 62px; margin: 2px 10px 2px 0; }
.hint .shape svg { display: block; width: 100%; height: auto; }
.hint .shape__text { display: block; font-weight: 700; }
.hint .shape__tip { display: block; margin-top: 4px; clear: both; }

/* =====================================================================
   THE SNAKE PAGE: the zigzag. Rows of pieces on the desk; a row ends with a bend down and the next row runs back.
   Pieces touch, so the bends join exactly; a dark slit separates the rows where the snake does not cross.
   ===================================================================== */
.zig { padding: 18px 14px; display: flex; flex-direction: column; gap: 10px; }
.zig__main { display: flex; gap: 10px; align-items: flex-start; }
.zig__scroll { flex: 1 1 0; min-width: 0; overflow-x: auto; padding: 4px 2px 8px; }
.zig__grid { --cols: 5; display: grid; grid-template-columns: repeat(var(--cols), minmax(52px, 1fr)); max-width: calc(var(--cols) * 216px); margin: 0 auto; filter: drop-shadow(2px 8px 6px var(--wood-shadow)); }
.zt { position: relative; display: block; border: 0; padding: 0; margin: 0; background: var(--scrap); aspect-ratio: 4 / 3; min-width: 0; cursor: pointer; }
.zt img { display: block; width: 100%; height: 100%; max-width: none; }
.zt::before { content: ""; position: absolute; inset: 0; border-left: 1px dashed var(--dash); pointer-events: none; z-index: 1; }
.zt--cut-t::after, .zt--cut-b::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: rgba(70, 35, 5, 0.6); pointer-events: none; z-index: 2; }
.zt--cut-t::after { top: -1.5px; } .zt--cut-b::after { bottom: -1.5px; }
.zt--cut-t.zt--cut-b::after { top: -1.5px; height: auto; bottom: -1.5px; background: linear-gradient(rgba(70, 35, 5, 0.6) 0 3px, transparent 3px calc(100% - 3px), rgba(70, 35, 5, 0.6) calc(100% - 3px)); }
.zt:focus-visible { outline-offset: -4px; z-index: 3; }
.zt__n { position: absolute; left: 4px; top: 3px; z-index: 2; background: var(--scrap); font-family: var(--hand); font-weight: 700; font-size: 0.85rem; line-height: 1; padding: 1px 4px; display: none; }
.zt__blank { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--hand); font-weight: 700; color: var(--ink-2); }
.zt--next { background: var(--sun); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; outline: 3px dashed var(--ink); outline-offset: -3px; font-family: var(--hand); font-weight: 700; font-size: 0.8rem; line-height: 1; color: var(--ink); }
.zt--next svg { display: block; width: 58%; max-width: 70px; height: auto; }
.zt--next span { display: none; }
.zig__map { flex: 0 0 28px; width: 28px; border-radius: 8px; background: var(--scrap); box-shadow: 2px 4px 4px rgba(50, 25, 0, 0.35); cursor: pointer; position: sticky; top: 80px; }
.zig__more { align-self: stretch; min-height: 48px; border: 0; background: var(--scrap); font-family: var(--hand); font-weight: 700; font-size: 1.2rem; color: var(--ink); box-shadow: 2px 5px 5px rgba(50, 25, 0, 0.35); }
/* a torn edge: the paper goes on above (or below) */
.zig__more--earlier { clip-path: polygon(0 0, 100% 0, 100% 78%, 96% 100%, 91% 80%, 86% 98%, 80% 78%, 74% 100%, 68% 82%, 62% 98%, 55% 78%, 49% 100%, 43% 80%, 37% 98%, 30% 78%, 24% 100%, 18% 82%, 12% 98%, 6% 78%, 0 100%); padding-bottom: 10px; }
.zig__more--later { clip-path: polygon(0 22%, 6% 0, 12% 20%, 18% 2%, 24% 22%, 30% 0, 37% 20%, 43% 2%, 49% 22%, 55% 0, 62% 20%, 68% 2%, 74% 22%, 80% 0, 86% 20%, 91% 2%, 96% 22%, 100% 0, 100% 100%, 0 100%); padding-top: 10px; }
@media (min-width: 760px) {
  .zig { padding: 26px 22px; }
  .zt__n { display: block; }
  .zt--next span { display: block; font-size: 1.3rem; }
}
/* one piece, large, with the pieces around it */
.zd__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; align-items: center; background: var(--wood) url("img/desk.jpg") center / cover; border-radius: 14px; padding: 10px; overflow: hidden; }
.zd__cell { aspect-ratio: 4 / 3; background: var(--scrap); min-width: 0; }
.zd__cell img { display: block; width: 100%; height: 100%; }
.zd__cell--side { opacity: 0.6; }
.zd__grid--solo { grid-template-columns: minmax(0, 1fr); }
.zd__small { flex-basis: 100%; font-weight: 400; font-size: 0.875rem; color: var(--ink-2); }
.keepline { text-align: center; margin: 4px 0 0; }
.zd__cap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-weight: 700; min-height: 44px; }
.zd__nav { justify-content: space-between; }
