:root {
  --bg: #f4efe6;
  --ink: #2b2a28;
  --muted: #6f6a60;
  --cork: #c9a77c;
  --accent: #2b2a28;

  --yellow: #fff38a;
  --pink: #ffb3cf;
  --blue: #a8daff;
  --green: #b8f2a0;
  --orange: #ffc98a;
  --purple: #d7b8ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

a { color: inherit; }

/* ---------- top nav ---------- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}
.brand {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.nav-link {
  text-decoration: none;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
}

/* ---------- compose page ---------- */
.compose {
  max-width: 520px;
  margin: 24px auto 64px;
  padding: 0 16px;
  text-align: center;
}
.compose h1 { margin: 0 0 4px; font-size: 2rem; }
.compose .sub { margin: 0 0 28px; color: var(--muted); }

.note-editor {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 360px;
  margin: 0 auto 20px;
  padding: 28px 24px 36px;
  background: var(--yellow);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
  transform: rotate(-1.5deg);
  transition: background 0.2s;
}
.note-editor textarea {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  resize: none;
  font: inherit;
  font-family: "Comic Sans MS", "Marker Felt", "Segoe Print", cursive;
  font-size: 1.3rem;
  line-height: 1.4;
  color: var(--ink);
  outline: none;
}
.note-editor .counter {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.45);
}

.colors {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}
.swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s;
}
.swatch:hover { transform: scale(1.1); }
.swatch[aria-checked="true"] { border-color: var(--ink); }

.name-input {
  width: 100%;
  max-width: 360px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 2px solid #ddd5c6;
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.name-input:focus { outline: none; border-color: var(--ink); }

.post-btn {
  width: 100%;
  max-width: 360px;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
}
.post-btn:disabled { opacity: 0.5; cursor: default; }

.status { min-height: 1.5em; margin-top: 14px; font-weight: 600; }
.status.error { color: #b3261e; }

/* ---------- wall page ---------- */
.wall-page {
  background-color: var(--cork);
  background-image: radial-gradient(rgba(0, 0, 0, 0.06) 1px, transparent 1px);
  background-size: 6px 6px;
}
.wall-page .nav { background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 10; }

.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 28px;
  padding: 32px 24px 64px;
  max-width: 1400px;
  margin: 0 auto;
}

.sticky {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 26px 18px 18px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s;
  animation: drop-in 0.35s ease-out;
}
.sticky:hover { transform: rotate(0deg) scale(1.04) !important; z-index: 2; }
.sticky::before {
  /* a pin */
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: #d33;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.35);
}
.sticky .msg {
  flex: 1;
  margin: 0;
  font-family: "Comic Sans MS", "Marker Felt", "Segoe Print", cursive;
  font-size: 1.05rem;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: hidden;
}
.sticky .meta {
  margin-top: 8px;
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.empty {
  text-align: center;
  padding: 80px 16px;
  font-size: 1.2rem;
  color: #3d3326;
}

@keyframes drop-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
}

/* color classes */
.c-yellow { background: var(--yellow); }
.c-pink   { background: var(--pink); }
.c-blue   { background: var(--blue); }
.c-green  { background: var(--green); }
.c-orange { background: var(--orange); }
.c-purple { background: var(--purple); }

@media (max-width: 480px) {
  .nav { padding: 12px 16px; }
  .wall { grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 20px 16px 48px; }
  .sticky .msg { font-size: 0.9rem; }
}
