/* Copyright (c) 2026 Peter Mayhew. All rights reserved. Not licensed for copying or reuse. */
/* One big butter-yellow enamel fridge door. Paper and magnets are the only loose things on it. */
:root {
  color-scheme: light;
  --enamel: #f6c945; --enamel-light: #fbd96e; --enamel-edge: #c99a15;
  --wall: #dfe9ea; --grout: #cbd8da;
  --ink: #2b2412; --soft: #5d4c16;
  --paper: #fffef9; --line: #d9d2bd;
  --red: #d8322c; --blue: #2455c9; --green: #14794a; --white: #fffdf5;
  --chrome: #f4f6f6; --chrome-dark: #8d9a9d;
  --shadow: rgb(70 48 0 / 0.32);
  --round: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", "Trebuchet MS", system-ui, sans-serif;
  font: 17px/1.45 var(--round);
}
@media (prefers-color-scheme: dark) {
  :root { --enamel: #cf9f22; --enamel-light: #dcb03a; --enamel-edge: #8f6a0a; --wall: #17201f; --grout: #222e2d; --ink: #1d1707; --soft: #3d3008; --shadow: rgb(25 15 0 / 0.5); --paper: #fbf8ee; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; color: var(--ink); min-height: 100dvh;
  background: var(--wall) repeating-linear-gradient(0deg, var(--grout) 0 2px, transparent 2px 92px);
}
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: repeating-linear-gradient(90deg, var(--grout) 0 2px, transparent 2px 92px); }
h1, h2, p { margin: 0; }
h1 { font-size: 1.5rem; line-height: 1.1; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
#main:focus { outline: none; }

.door {
  width: min(100%, 1180px); margin: 0 auto; min-height: 100dvh; position: relative;
  background: linear-gradient(105deg, var(--enamel-light), var(--enamel) 38%);
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
@media (min-width: 860px) {
  .door { margin-block: 28px; min-height: calc(100dvh - 56px); border-radius: 42px; padding: 26px 44px 28px 92px; box-shadow: inset 0 0 0 3px var(--enamel-light), inset -12px -14px 0 -4px var(--enamel-edge), 0 18px 34px rgb(0 0 0 / 0.28); }
  .door::before { content: ""; position: sticky; float: left; top: 30vh; margin-left: -62px; width: 26px; height: 260px; border-radius: 14px; background: linear-gradient(90deg, var(--chrome-dark), var(--chrome) 30%, #fff 48%, var(--chrome) 60%, var(--chrome-dark)); box-shadow: 5px 8px 10px var(--shadow); }
}

header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; margin-bottom: 18px; }
#letters { display: flex; text-decoration: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.letter { font-size: clamp(1.75rem, 7.4vw, 3.3rem); font-weight: 900; line-height: 1; padding: 0 0.03em; cursor: grab; transition: translate 0.25s cubic-bezier(.3,1.6,.6,1); position: relative; z-index: 2; }
.letter:active { transition: none; cursor: grabbing; }
.space { width: 0.45rem; }
@media (min-width: 560px) { .space { width: 1.2rem; } }
.l0 { color: var(--red); text-shadow: 0 1px #9c1f1a, 0 2px #9c1f1a, 0 3px #9c1f1a, 0 6px 5px var(--shadow); }
.l1 { color: var(--blue); text-shadow: 0 1px #163a91, 0 2px #163a91, 0 3px #163a91, 0 6px 5px var(--shadow); }
.l2 { color: var(--green); text-shadow: 0 1px #0a4d2e, 0 2px #0a4d2e, 0 3px #0a4d2e, 0 6px 5px var(--shadow); }
.l3 { color: var(--white); text-shadow: 0 1px #b8ae90, 0 2px #b8ae90, 0 3px #b8ae90, 0 6px 5px var(--shadow); }
.t0 { rotate: -6deg; } .t1 { rotate: 4deg; } .t2 { rotate: -2deg; } .t3 { rotate: 7deg; } .t4 { rotate: -4deg; }
nav { display: flex; gap: 8px; }
.tab { font-weight: 800; text-decoration: none; padding: 8px 18px; min-height: 46px; display: inline-flex; align-items: center; border-radius: 23px; }
.tab[aria-current] { background: var(--ink); color: var(--white); }
.tab:not([aria-current]):hover { background: rgb(255 255 255 / 0.4); }

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
.plain { font-weight: 700; background: var(--paper); border: 2px solid transparent; border-radius: 12px; min-height: 46px; padding: 8px 16px; box-shadow: 0 2px 0 var(--enamel-edge); }
.plain:hover:not(:disabled) { border-color: var(--ink); }
.plain:disabled { opacity: 0.5; }
.plain[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.big { font-weight: 900; font-size: 1.12rem; background: var(--red); color: #fff; border: 0; border-radius: 16px; min-height: 56px; padding: 10px 24px; box-shadow: 0 4px 0 #8f1813; }
.big:hover:not(:disabled) { background: #c42a25; }
.big:active:not(:disabled) { translate: 0 3px; box-shadow: 0 1px 0 #8f1813; }
.big:disabled { background: #7c6a3a; box-shadow: none; opacity: 0.6; }
.link { background: none; border: 0; padding: 8px 4px; min-height: 44px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.label { font-size: 0.82rem; font-weight: 700; color: var(--soft); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
footer { margin-top: 36px; font-size: 0.9rem; clear: both; }

/* --- the fridge --- */
.sorts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr)); gap: 34px 26px; align-items: start; }
@media (max-width: 559px) { .grid { grid-template-columns: 1fr 1fr; gap: 26px 14px; } }
.sheet { min-width: 0; rotate: var(--tilt, -1.5deg); transition: rotate 0.2s; }
.sheet:hover { rotate: 0deg; }
.picture, .blank a { display: block; position: relative; width: 100%; padding: 0; border: 0; text-align: left; background: var(--paper); box-shadow: 2px 7px 12px var(--shadow); text-decoration: none; }
.picture canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.caption { display: flex; flex-direction: column; padding: 8px 12px 18px; line-height: 1.25; }
.by { font-weight: 800; overflow-wrap: anywhere; }
.what { font-size: 0.85rem; color: #5c543f; }
.pin { position: absolute; z-index: 1; left: 50%; top: -11px; translate: -50% 0; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgb(255 255 255 / 0.75) 0 10%, transparent 34%), var(--red); box-shadow: 0 4px 5px var(--shadow); }
.p1 { background-color: var(--blue); } .p2 { background-color: var(--green); } .p3 { background-color: #3a3322; }
.blankpaper { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 8px; aspect-ratio: 1; padding: 22px 16px 14px; }
.blankpaper strong { font-size: 1.35rem; line-height: 1.15; text-wrap: balance; }
.blankpaper .big { display: inline-flex; align-items: center; margin-top: 6px; min-height: 48px; padding: 6px 20px; }
@media (max-width: 559px) { .blankpaper strong { font-size: 1.05rem; } .blankpaper { aspect-ratio: auto; min-height: 100%; padding-top: 26px; } .blank { align-self: stretch; } .blank a { height: 100%; } .caption { padding: 6px 8px 16px; } }
.waiting { font-size: 0.88rem; font-weight: 700; background: var(--ink); color: var(--white); padding: 6px 12px; }
.fridgenote { margin-top: 22px; font-weight: 700; }
.more { margin: 28px auto 0; display: block; }

.magnets { display: flex; flex-wrap: wrap; gap: 6px; margin: -12px 8px 0; position: relative; z-index: 2; }
.magnet { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; min-height: 44px; padding: 4px 9px; border-radius: 22px; border: 2px solid transparent; background: var(--white); box-shadow: 0 3px 5px var(--shadow); font-weight: 800; font-variant-numeric: tabular-nums; }
.magnet .emoji { font-size: 1.2rem; line-height: 1; transition: scale 0.15s; }
.magnet:hover:not(:disabled) .emoji { scale: 1.3; }
.magnet[aria-pressed="true"] { border-color: var(--blue); background: #dfe8ff; }
.magnet:disabled { opacity: 0.85; }
.add { font-size: 1.15rem; }
.bit { position: fixed; z-index: 60; font-size: 1.5rem; pointer-events: none; }

/* --- drawing --- */
.idea { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-bottom: 12px; }
.idea strong { font-size: clamp(1.15rem, 4.5vw, 1.6rem); line-height: 1.15; font-weight: 900; }
.ideabuttons { display: inline-flex; gap: 14px; }
.ideabuttons .link { min-height: 40px; padding-block: 4px; }
.desk { display: grid; gap: 18px; }
@media (min-width: 860px) { .desk { grid-template-columns: minmax(0, min(62%, calc(100dvh - 190px))) minmax(260px, 1fr); gap: 34px; align-items: start; } }
.easel { position: relative; min-width: 0; }
.easel .pin { width: 36px; height: 36px; top: -15px; pointer-events: none; }
.sheetbox { position: relative; box-shadow: 3px 9px 16px var(--shadow); }
#sheet { display: block; width: 100%; aspect-ratio: 1; touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.cursor { position: absolute; width: 22px; height: 22px; translate: -50% -50%; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 3px #000; pointer-events: none; }
.fold { position: absolute; inset: 0 auto 0 50%; border-left: 2px dashed rgb(128 128 128 / 0.7); pointer-events: none; }
.kit { display: grid; gap: 14px; min-width: 0; }
.kit .big { width: 100%; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices button { border: 0; padding: 0; background: none; }
.choices [aria-pressed="true"] { position: relative; }
.tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tools button { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 1px; background: var(--paper); border: 3px solid transparent; border-radius: 12px; padding: 4px 1px 5px; font-size: 0.74rem; font-weight: 800; min-height: 64px; box-shadow: 0 2px 0 var(--enamel-edge); }
.tools canvas, .stamps canvas { width: 36px; height: 36px; }
.tools [aria-pressed="true"], .stamps [aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--white); }
.rubber { width: 30px; height: 18px; margin: 9px 0; border-radius: 4px; rotate: -16deg; background: linear-gradient(90deg, var(--blue) 0 48%, #f39aa8 48%); }
.stamps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.stamps button { background: var(--paper); border: 3px solid transparent; border-radius: 12px; min-height: 48px; display: grid; place-items: center; }
.colours { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.colours.off { opacity: 0.4; }
.colours button, .papers button { min-height: 44px; border-radius: 12px; background: var(--c); border: 2px solid rgb(0 0 0 / 0.28); }
.colours [aria-pressed="true"], .papers [aria-pressed="true"] { box-shadow: 0 0 0 3px var(--white), 0 0 0 6px var(--ink); }
.colours [aria-pressed="true"]::after, .papers [aria-pressed="true"]::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 2px #000; }
.sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sizes button { min-height: 46px; border-radius: 12px; background: var(--paper); border: 3px solid transparent; display: grid; place-items: center; box-shadow: 0 2px 0 var(--enamel-edge); }
.sizes [aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--white); }
.dot { border-radius: 50%; background: var(--ink); }
.d0 { width: 5px; height: 5px; } .d1 { width: 11px; height: 11px; } .d2 { width: 20px; height: 20px; } .d3 { width: 32px; height: 32px; }
.acts { display: grid; grid-template-columns: repeat(4, auto); gap: 8px; }
.acts .plain { padding-inline: 6px; font-size: 0.92rem; }
.paperline { display: flex; align-items: center; gap: 12px; }
.papers { flex: 1; display: grid; grid-template-columns: repeat(6, 1fr); }

@media (max-width: 559px) {
  header { flex-wrap: nowrap; gap: 8px; margin-bottom: 12px; }
  .letter { font-size: clamp(1.1rem, 5.7vw, 1.8rem); }
  nav { gap: 0; flex: none; }
  .tab { padding: 8px 12px; font-size: 0.92rem; }
  .acts { order: -1; }
  .kit { gap: 11px; }
}

/* --- close-up and finishing --- */
dialog { border: 0; padding: 0; background: var(--paper); color: var(--ink); width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; border-radius: 4px; box-shadow: 0 20px 60px rgb(0 0 0 / 0.5); }
dialog::backdrop { background: rgb(35 25 0 / 0.66); }
dialog form, .close-up { padding: 18px; display: grid; gap: 14px; justify-items: start; }
dialog .plain { background: #f1ecdb; box-shadow: none; }
.preview { display: block; width: min(100%, 56dvh); aspect-ratio: 1; justify-self: center; box-shadow: 1px 3px 9px rgb(0 0 0 / 0.25); }
#finish .preview { width: min(62%, 34dvh); }
h2 { font-size: 1.4rem; font-weight: 900; line-height: 1.15; }
.close-up { position: relative; }
.x { position: sticky; top: 10px; justify-self: end; z-index: 3; margin: 0 0 -58px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 1.6rem; line-height: 1; translate: 8px -4px; }
.who { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: baseline; }
.who strong { font-size: 1.2rem; font-weight: 900; overflow-wrap: anywhere; }
.when { color: #6b6248; font-size: 0.9rem; }
.close-up .magnets { margin: 0; }
.close-up .magnet { background: #f1ecdb; box-shadow: none; }
.close-up .magnet[aria-pressed="true"] { background: #dfe8ff; }
.browse { flex-wrap: nowrap; }
.links { gap: 4px 18px; }
.extra:empty { display: none; }
.extra { display: grid; gap: 8px; }
.sign { display: grid; gap: 4px; width: 100%; }
.sign label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; }
.sign input[type="radio"] { width: 22px; height: 22px; accent-color: var(--blue); }
.sign input[type="text"] { font: inherit; width: 100%; min-height: 48px; padding: 8px 14px; border: 2px solid #8a7f61; border-radius: 10px; background: #fff; color: var(--ink); }
.sign input[type="text"]:disabled { opacity: 0.45; }
.small { font-size: 0.9rem; color: #5c543f; }
.error { color: #a81d17; font-weight: 700; }
.error:empty { display: none; }
#say { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); translate: -50% 30px; z-index: 50; width: max-content; max-width: calc(100vw - 32px); background: var(--ink); color: var(--white); font-weight: 700; padding: 12px 20px; border-radius: 14px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.2s, translate 0.2s, visibility 0.2s; }
#say.on { opacity: 1; visibility: visible; translate: -50% 0; }

/* --- pages of writing, and the moderator's page --- */
.paper-note { background: var(--paper); padding: 26px clamp(18px, 4vw, 40px) 30px; max-width: 44rem; box-shadow: 2px 7px 12px var(--shadow); }
.paper-note h2 { margin: 1.3em 0 0.35em; }
.paper-note > h2:first-child { margin-top: 0; }
.paper-note p, .paper-note ul { margin: 0.5em 0; }
.review { display: grid; gap: 8px; background: var(--paper); padding: 10px; min-width: 0; align-content: start; }
.review canvas { width: 100%; aspect-ratio: 1; display: block; }
.review .flag { color: #a81d17; font-weight: 800; }
.keyform { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.keyform input { font: inherit; min-height: 48px; padding: 8px 14px; border: 2px solid #8a7f61; border-radius: 10px; width: min(100%, 320px); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
