/* WALL 공통 (첫 화면·참여·관리) — 밝은 종이 느낌 */
:root {
  --paper: #f7f2e7;
  --paper-2: #efe7d6;
  --ink: #2b2620;
  --ink-2: #6b6256;
  --line: #ddd2bd;
  --card: #fffdf8;
  --accent: #e0573f;      /* 붉은 주황: 버튼 */
  --accent-ink: #fff;
  --ok: #2f7d5b;
  --warn: #b5432f;
  --c-yellow: #ffe57a;
  --c-pink: #ffb8c6;
  --c-mint: #a9e5c8;
  --c-sky: #a8d4f5;
  --c-lavender: #cdbdf2;
  --c-peach: #ffc79a;
  --radius: 14px;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  background-image: radial-gradient(rgba(120, 100, 70, .07) 1px, transparent 1px);
  background-size: 22px 22px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  border: 1.5px solid var(--line); background: var(--card); border-radius: 999px;
  padding: .55em 1.1em; cursor: pointer; text-decoration: none; font-weight: 600;
  transition: transform .08s, background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { border-color: #c9bb9f; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #cc4a33; }
.btn.danger { color: var(--warn); }
.btn.small { padding: .35em .8em; font-size: .9em; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: .9em; color: var(--ink-2); margin-bottom: 4px; font-weight: 600; }
.input, textarea.input, select.input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card);
  padding: .6em .8em; outline: none;
}
.input:focus { border-color: #b9a682; box-shadow: 0 0 0 3px rgba(224, 87, 63, .12); }

.flash { padding: .7em 1em; border-radius: 10px; margin: 0 0 14px; font-weight: 600; }
.flash.error { background: #fde4dd; color: var(--warn); }
.flash.ok { background: #dff2e8; color: var(--ok); }

.wordmark { font-weight: 900; letter-spacing: .14em; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.wordmark i { display: inline-block; width: 14px; height: 14px; background: var(--c-yellow); transform: rotate(-6deg); box-shadow: 4px 3px 0 var(--c-pink); }

/* ---------------- 첫 화면 / 안내 */
.center-page { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.center-page h1 { font-size: clamp(28px, 6vw, 44px); margin: 18px 0 6px; letter-spacing: -.02em; }
.center-page p { color: var(--ink-2); margin: 0 0 22px; }
.code-form { display: flex; gap: 8px; width: min(420px, 100%); }
.code-form .input { text-transform: uppercase; letter-spacing: .25em; text-align: center; font-size: 22px; font-weight: 800; }

/* ---------------- 참여 화면 */
.join {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: center;
  width: min(760px, 100%); margin: 0 auto; padding: 18px 16px 24px;
}
.join-head { margin-bottom: 14px; }
.join-head .wordmark { font-size: 12px; color: var(--ink-2); }
.join-head h1 { margin: 6px 0 2px; font-size: clamp(22px, 5vw, 34px); letter-spacing: -.02em; line-height: 1.25; }
.join-head p { margin: 0; color: var(--ink-2); font-size: clamp(15px, 3.6vw, 19px); }

.tabs { display: inline-flex; background: var(--paper-2); border-radius: 999px; padding: 4px; margin: 4px 0 14px; }
.tabs button { border: 0; background: transparent; border-radius: 999px; padding: .5em 1.2em; font-weight: 700; cursor: pointer; display: inline-flex; gap: .4em; align-items: center; color: var(--ink-2); }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.note-wrap { position: relative; }
.note {
  display: block; width: 100%; min-height: 220px; height: clamp(220px, 38dvh, 460px); resize: none; border: 0; outline: none;
  padding: 28px 24px 34px; font-size: clamp(20px, 4.6vw, 28px); line-height: 1.45; font-weight: 600;
  background: var(--c-yellow); border-radius: 4px 4px 4px 22px;
  box-shadow: 0 1px 1px rgba(0,0,0,.08), 0 10px 22px -10px rgba(60,40,10,.35);
  transition: background .2s;
}
.note::placeholder { color: rgba(43,38,32,.4); }
.counter { position: absolute; right: 14px; bottom: 10px; font-size: 13px; color: rgba(43,38,32,.55); font-weight: 700; }
.counter.over { color: var(--warn); }

.swatches { display: flex; gap: 10px; margin: 14px 0 4px; flex-wrap: wrap; align-items: center; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.swatch[aria-pressed="true"] { border-color: var(--ink); }

.c-yellow { --c: var(--c-yellow); } .c-pink { --c: var(--c-pink); } .c-mint { --c: var(--c-mint); }
.c-sky { --c: var(--c-sky); } .c-lavender { --c: var(--c-lavender); } .c-peach { --c: var(--c-peach); }
.swatch { background: var(--c); }

.canvas-box {
  position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 58dvh; margin: 0 auto;
  background: #fff; border-radius: 6px; box-shadow: 0 1px 1px rgba(0,0,0,.08), 0 10px 22px -10px rgba(60,40,10,.35);
  overflow: hidden; touch-action: none;
}
.canvas-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.canvas-box .hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #bbb; font-size: clamp(16px, 3.5vw, 22px); pointer-events: none; transition: opacity .2s; }
.draw-tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 12px 0 4px; }
.pens { display: flex; gap: 8px; flex-wrap: wrap; }
.pen { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.pen[aria-pressed="true"] { border-color: var(--ink); outline: 2px solid #fff; outline-offset: -5px; }
.sizes { display: flex; gap: 4px; background: var(--paper-2); border-radius: 999px; padding: 3px; }
.size { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.size i { display: block; background: var(--ink); border-radius: 50%; }
.size[aria-pressed="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.tool { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.tool[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tool-group { display: flex; gap: 6px; margin-left: auto; }

.join-foot { display: flex; gap: 10px; margin-top: 16px; align-items: stretch; }
.join-foot .input { flex: 1; min-width: 0; font-size: 17px; }
.join-foot .btn.primary { font-size: 19px; padding: .7em 1.6em; }
.err { min-height: 1.5em; color: var(--warn); font-weight: 700; margin-top: 8px; }

.done {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(247, 242, 231, .96); z-index: 20; text-align: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.done.on { opacity: 1; pointer-events: auto; }
.done .mark { width: 96px; height: 96px; border-radius: 50%; background: var(--ok); color: #fff; display: flex; align-items: center; justify-content: center; transform: scale(.6); transition: transform .35s cubic-bezier(.2,1.6,.4,1); }
.done.on .mark { transform: scale(1); }
.done .mark .icon { width: 54px; height: 54px; }
.done h2 { font-size: clamp(26px, 6vw, 40px); margin: 22px 0 6px; }
.done p { color: var(--ink-2); margin: 0 0 22px; font-size: 18px; }

.closed { text-align: center; padding: 40px 10px; }
.closed .icon { width: 48px; height: 48px; color: var(--ink-2); }

/* 큰 터치 화면(전자칠판 등): 글씨·도구를 키우고 화면 가운데~아래쪽에 모은다 */
@media (min-width: 1300px) and (min-height: 850px) {
  .join { width: min(1200px, 100%); }
  .canvas-box { max-height: 60dvh; }
  .pen { width: 52px; height: 52px; }
  .size, .tool { width: 54px; height: 54px; }
  .swatch { width: 54px; height: 54px; }
  .tabs button { font-size: 22px; }
  .join-foot .btn.primary { font-size: 26px; }
  .join-foot .input { font-size: 22px; }
}
/* 키오스크: 위쪽 여백을 더 두어 손이 닿는 높이로 */
.kiosk .join { justify-content: flex-end; padding-bottom: 6dvh; }

/* ---------------- 관리 */
.admin-top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: rgba(255,253,248,.7); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px); }
.admin-top .who { margin-left: auto; color: var(--ink-2); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.admin-main { width: min(1080px, 100%); margin: 0 auto; padding: 20px 16px 60px; }
.admin-main h1 { font-size: 26px; margin: 4px 0 16px; letter-spacing: -.02em; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.panel h2 { font-size: 18px; margin: 0 0 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--ink-2); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--paper-2); }
.pill.open { background: #dff2e8; color: var(--ok); }
.pill.closed { background: #eee; color: #777; }
.pill.pending { background: #fff1c9; color: #8a6400; }

.board-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.board-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; display: block; transition: transform .1s, box-shadow .15s; }
.board-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -12px rgba(60,40,10,.4); }
.board-card h3 { margin: 6px 0 4px; font-size: 18px; }
.board-card .code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; letter-spacing: .12em; }

.links { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.link-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.link-row:last-child { border-bottom: 0; }
.link-row b { min-width: 92px; font-size: 14px; }
.link-row code { font-size: 14px; background: var(--paper-2); padding: 2px 8px; border-radius: 6px; word-break: break-all; }
.qr-img { width: 150px; height: 150px; background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--line); }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filters button { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: .35em .9em; cursor: pointer; font-weight: 600; font-size: 14px; }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.post { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); display: flex; flex-direction: column; }
.post .pv { aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; padding: 12px; font-weight: 600; font-size: 15px; text-align: center; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; overflow: hidden; background: var(--c, #fff); }
.post .pv img { max-width: 100%; max-height: 100%; }
.post.hidden .pv { opacity: .35; }
.post .meta { padding: 8px 10px 0; font-size: 13px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.post .acts { display: flex; gap: 6px; padding: 8px 10px 10px; flex-wrap: wrap; }
.post .acts .btn { padding: .3em .7em; font-size: 13px; }
.post.new { animation: flashNew 1.4s ease-out; }
@keyframes flashNew { from { box-shadow: 0 0 0 4px var(--accent); } to { box-shadow: 0 0 0 0 transparent; } }

details.panel > summary { cursor: pointer; font-weight: 800; font-size: 18px; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "+"; float: right; color: var(--ink-2); }
details.panel[open] > summary::after { content: "–"; }
details.panel[open] > summary { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.checks { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.checks label { display: flex; gap: 6px; align-items: center; font-weight: 600; }
@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .links { grid-template-columns: 1fr; }
  .admin-top .who span { display: none; }
}
