:root {
  --ink: #1e1e1e;
  --ink-2: #4a4a4a;
  --ink-3: #5c5c5c;
  --paper: #f5f5f3;
  --dots: #cfd1d6;
  --card: #ffffff;
  --line: #d9d9d6;
  --soft: #f7f7f5;
  --blue: #1f5fd1;
  --blue-soft: #eef4ff;
  --blue-line: #cbd6ea;
  --magenta: #b4235a;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Figtree, 'Noto Sans SC', system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(var(--dots) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
}

a { color: var(--blue); }
a:hover { color: #163f8c; }

input, textarea, button { font: inherit; color: inherit; }

input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 95, 209, 0.25);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- top bar ---------- */
.topbar {
  max-width: 1360px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 12px; padding: 8px 14px 8px 8px; box-shadow: var(--shadow);
}
.logo {
  width: 32px; height: 32px; border-radius: 8px; background: #ffe99a;
  display: flex; align-items: center; justify-content: center;
}
.brand { font-weight: 700; font-size: 15px; color: var(--ink); text-decoration: none; }
.count { font-size: 13px; color: var(--ink-3); padding-left: 10px; border-left: 1px solid #e3e3e0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: none;
  font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer;
}
.btn-light { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.btn-light:hover { color: var(--ink); }
.btn-blue { background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(31, 95, 209, 0.3); }
.btn-blue:hover { color: #fff; background: #1a52b8; }
.btn-dark { background: var(--ink); color: #fff; min-height: 52px; padding: 0 24px; border-radius: 14px; font-size: 16px; }
.btn-dark:hover { background: #000; }
.btn-dark[disabled] { opacity: 0.5; cursor: progress; }

.scribble { font-family: Caveat, cursive; font-weight: 700; color: var(--magenta); }

/* ---------- form page ---------- */
.form-page { padding: 32px 16px 96px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.form-page .topbar { width: 100%; max-width: 1120px; }
.hero { width: 100%; max-width: 720px; text-align: center; display: flex; flex-direction: column; gap: 8px; }
.hero .scribble { font-size: 30px; transform: rotate(-3deg); }
.hero h1 { margin: 0; font-size: clamp(36px, 6vw, 56px); line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; }

.card {
  width: 100%; max-width: 720px; background: var(--card); border-radius: 24px;
  padding: clamp(20px, 4vw, 40px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.08);
  display: flex; flex-direction: column; gap: 32px;
}
.panel { display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: 16px; background: var(--soft); }
.panel-blue { background: var(--blue-soft); gap: 14px; }
.panel-title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.panel-title .emoji { font-size: 28px; line-height: 1; }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-weight: 700; font-size: 14px; }
.text-input {
  min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 16px; background: #fff; width: 100%;
}
.panel-blue .text-input { border-color: var(--blue-line); font-size: 15px; }
textarea.text-input { padding: 12px 14px; line-height: 1.5; resize: vertical; min-height: 96px; }
.text-input:focus { border-color: var(--blue); }
.text-input.over { border-color: var(--magenta); }

.question { display: flex; flex-direction: column; gap: 8px; border: none; margin: 0; padding: 0; min-width: 0; }
.q-title { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; font-size: 17px; line-height: 1.35; padding: 0; }
.q-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800;
}
.q-hint { font-size: 13px; color: var(--ink-3); line-height: 1.4; margin-top: -2px; }
.q-muted { font-weight: 500; color: var(--ink-3); }
legend.q-title { margin-bottom: 12px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  min-height: 44px; padding: 0 16px; border-radius: 999px; font-size: 15px; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
}
.pill[aria-pressed='true'] { background: var(--ink); color: #fff; border-color: var(--ink); }
#area-other { max-width: 360px; }

.word-count { align-self: flex-end; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.word-count.over { color: var(--magenta); }

.notice { margin: 0; font-size: 15px; line-height: 1.5; }

.submit-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.form-error { margin: 0; color: var(--magenta); font-weight: 600; font-size: 14px; min-height: 1em; }

/* ---------- board page ---------- */
.board-page { padding: 20px 16px 120px; }
.facepile { display: flex; align-items: center; background: var(--card); border-radius: 12px; padding: 6px 10px 6px 6px; box-shadow: var(--shadow); }
.facepile .avatar { width: 32px; height: 32px; font-size: 12px; margin-right: -6px; box-shadow: 0 0 0 2px #fff; }
.facepile-more { font-size: 13px; font-weight: 600; color: var(--ink-2); padding-left: 14px; }

.board-head { max-width: 1360px; margin: 28px auto 0; display: flex; flex-direction: column; gap: 16px; }
.board-head .scribble { font-size: 26px; transform: rotate(-2deg); transform-origin: left; margin-bottom: 2px; }
.board-head h1 { margin: 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters .pill { min-height: 40px; padding: 0 14px; font-size: 14px; }

.wall { max-width: 1360px; margin: 32px auto 0; column-width: 290px; column-gap: 36px; }
.note-wrap { break-inside: avoid; display: inline-block; width: 100%; padding: 6px 4px 30px; }
.note {
  position: relative; border-radius: 4px; padding: 20px 20px 18px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 8px 18px rgba(0, 0, 0, 0.09);
  overflow-wrap: anywhere;
}
.note.is-you { box-shadow: 0 0 0 3px var(--blue), 0 2px 4px rgba(0, 0, 0, 0.08), 0 14px 28px rgba(0, 0, 0, 0.14); }
.note.is-you.pop { animation: pop 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
@keyframes pop {
  0% { transform: scale(0.6) rotate(-8deg); opacity: 0; }
  70% { transform: scale(1.04) rotate(-1deg); opacity: 1; }
  100% { transform: scale(1) rotate(var(--rot)); }
}
@media (prefers-reduced-motion: reduce) { .note.is-you.pop { animation: none; } }
.you-badge {
  position: absolute; top: -14px; right: 14px; background: var(--blue); color: #fff;
  font-size: 12px; font-weight: 800; letter-spacing: 0.04em; padding: 5px 10px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(31, 95, 209, 0.35);
}
.note-head { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.75);
}
.who { display: flex; flex-direction: column; min-width: 0; }
.who-name { font-weight: 800; font-size: 17px; line-height: 1.2; }
.who-geo { font-size: 13px; color: #3d3d3d; line-height: 1.3; }
.takeaway { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
.takeaway a { color: inherit; }
.label { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.people { display: flex; flex-direction: column; gap: 4px; }
.people p { margin: 0; font-size: 14px; line-height: 1.45; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.65); }
.socials { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1.5px dashed rgba(0, 0, 0, 0.15); }
.social {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: 8px;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; text-decoration: none;
}
.social:hover { color: #fff; background: #000; }
.social-text { background: rgba(255, 255, 255, 0.7); color: var(--ink); user-select: all; }

.empty { max-width: 480px; margin: 64px auto; text-align: center; font-size: 17px; color: var(--ink-2); }

.dock {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; background: var(--card); border-radius: 14px; padding: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.12);
}
.dock a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px 0 9px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; }
.dock a:hover { background: var(--soft); color: var(--ink); }
.dock .sticky-icon { width: 26px; height: 26px; background: #ffe99a; border-radius: 3px; transform: rotate(-6deg); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); }
