:root {
  color-scheme: light;
  --ink: #2d241b;
  --muted: #6d5c4d;
  --paper: #fff6b8;
  --paper-pink: #ffb6c6;
  --paper-blue: #aee7ff;
  --paper-green: #c4f0a5;
  --cork-a: #d49a5b;
  --cork-b: #a86a36;
  --shadow: 0 14px 26px rgba(35, 24, 14, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(92, 54, 26, 0.2) 0 2px, transparent 3px),
    radial-gradient(circle at 80% 28%, rgba(92, 54, 26, 0.16) 0 2px, transparent 3px),
    radial-gradient(circle at 38% 78%, rgba(92, 54, 26, 0.14) 0 2px, transparent 3px),
    radial-gradient(circle at 64% 62%, rgba(255, 230, 176, 0.14) 0 1px, transparent 3px),
    linear-gradient(135deg, var(--cork-a), var(--cork-b));
  background-size: 120px 120px, 150px 150px, 180px 180px, 92px 92px, auto;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(35deg, rgba(255, 244, 204, 0.1) 25%, transparent 25%),
    linear-gradient(145deg, rgba(94, 49, 20, 0.09) 18%, transparent 18%);
  background-size: 38px 38px, 46px 46px;
  opacity: 0.85;
}

button,
select,
textarea {
  font: inherit;
}

.board-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.compose-note {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.76fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: end;
  width: min(960px, 100%);
  margin: 0 auto 30px;
  padding: 28px;
  background:
    linear-gradient(175deg, rgba(255, 255, 255, 0.28), transparent 34%),
    #fff3a3;
  border: 1px solid rgba(65, 45, 23, 0.16);
  border-radius: 6px;
  box-shadow: var(--shadow), 7px 10px 0 rgba(70, 42, 18, 0.09);
  transform: rotate(-1deg);
}

.compose-copy {
  display: grid;
  gap: 12px;
  justify-items: start;
  min-width: 0;
}

.crest-logo {
  width: min(180px, 58vw);
  max-width: 180px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 4px solid rgba(45, 36, 27, 0.55);
  border-radius: 8px;
  background: #f7e6bd;
  box-shadow: 0 8px 18px rgba(35, 24, 14, 0.22);
}

.eyebrow {
  margin: 0 0 6px;
  color: #8b3d2d;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
label,
button {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 9ch;
  margin: 0;
  font-size: 4rem;
  line-height: 0.95;
  letter-spacing: 0;
}

.complaint-form {
  display: grid;
  gap: 14px;
  min-width: 0;
}

label {
  display: grid;
  gap: 6px;
  color: #493521;
  font-size: 0.88rem;
  font-weight: 800;
}

select,
textarea {
  width: 100%;
  border: 2px solid rgba(45, 36, 27, 0.28);
  border-radius: 7px;
  background: rgba(255, 253, 239, 0.88);
  color: var(--ink);
}

select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(47, 136, 199, 0.45);
  outline-offset: 2px;
}

select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 112px;
  max-height: 260px;
  padding: 11px 12px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
}

button {
  min-height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 7px;
  padding: 0 18px;
  background: #2f2a23;
  color: #fff8dc;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(139, 61, 45, 0.45);
}

button:hover {
  background: #463626;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.form-status,
.board-status {
  min-height: 1.2em;
  color: #744235;
  font-size: 0.92rem;
  font-weight: 700;
}

.section-heading {
  display: flex;
  gap: 16px;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 14px;
  padding: 0 6px;
}

.section-heading h2 {
  margin: 0;
  color: #fff8dc;
  font-size: 1.5rem;
  letter-spacing: 0;
  text-shadow: 0 2px 0 rgba(61, 35, 17, 0.45);
}

.board-status {
  margin: 0;
  color: #fff8dc;
  text-align: right;
  text-shadow: 0 1px 0 rgba(61, 35, 17, 0.45);
}

.board-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.notes-board {
  position: relative;
  width: 1600px;
  height: 1200px;
  transform-origin: top left;
  background: rgba(255, 246, 184, 0.05);
  border-radius: 6px;
}

.sticky-note {
  position: absolute;
  width: 210px;
  min-height: 180px;
  margin: 0;
  padding: 22px 18px 18px;
  background:
    linear-gradient(178deg, rgba(255, 255, 255, 0.25), transparent 38%),
    var(--paper);
  border-radius: 5px;
  box-shadow: var(--shadow), 5px 7px 0 rgba(70, 42, 18, 0.08);
  transform: rotate(var(--rotation, -1deg));
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: opacity 0.18s ease;
}

.sticky-note.dragging {
  cursor: grabbing;
}

.sticky-note.removing {
  opacity: 0;
  pointer-events: none;
}

.sticky-note:nth-child(4n + 2) {
  background:
    linear-gradient(178deg, rgba(255, 255, 255, 0.26), transparent 38%),
    var(--paper-pink);
}

.sticky-note:nth-child(4n + 3) {
  background:
    linear-gradient(178deg, rgba(255, 255, 255, 0.26), transparent 38%),
    var(--paper-blue);
}

.sticky-note:nth-child(4n + 4) {
  background:
    linear-gradient(178deg, rgba(255, 255, 255, 0.26), transparent 38%),
    var(--paper-green);
}

.sticky-note header {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sticky-note h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.sticky-note time {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.sticky-note p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.note-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(45, 36, 27, 0.2);
  color: #2d241b;
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
  box-shadow: none;
}

.note-delete:hover {
  background: #8b3d2d;
  color: #fff8dc;
}

.pin {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px),
    #d74343;
  box-shadow: 0 3px 5px rgba(31, 20, 12, 0.28);
}

.compose-note > .pin,
.sticky-note > .pin {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
}

.sticky-note:nth-child(3n + 2) > .pin {
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px),
    #2c88c7;
}

.sticky-note:nth-child(3n + 3) > .pin {
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px),
    #2f9b67;
}

@media (max-width: 760px) {
  .board-shell {
    width: min(100% - 18px, 620px);
    padding-top: 14px;
  }

  .compose-note {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px 18px 20px;
    transform: rotate(-0.5deg);
  }

  .compose-copy {
    justify-items: center;
    text-align: center;
  }

  .crest-logo {
    width: min(156px, 70vw);
  }

  h1 {
    max-width: 10ch;
    font-size: 2.35rem;
  }

  .form-actions,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .board-status {
    text-align: left;
  }

  button {
    width: 100%;
  }
}
