:root {
  --ink: #1f2430;
  --sub: #5b6475;
  --line: #e3e6ec;
  --bg: #f6f7f9;
  --card: #ffffff;
  --blue: #2f6fec;
  --blue-dark: #2457c5;
  --ok: #1e8e4e;
  --ok-bg: #e7f6ed;
  --warn: #b3261e;
  --warn-bg: #fdecea;
  --note-yellow: #fff1a8;
  --note-pink: #ffd5e2;
  --note-blue: #cfe6ff;
  --note-green: #d3f2cf;
  --radius: 14px;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
main { max-width: 760px; margin: 0 auto; padding: 20px 16px 64px; }
main.wide { max-width: 1400px; }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 28px 0 10px; }
p { margin: 6px 0; }
.sub { color: var(--sub); font-size: .95rem; }
.small { font-size: .85rem; color: var(--sub); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

label { display: block; font-weight: 600; margin: 12px 0 6px; }
input, textarea, select {
  width: 100%; font: inherit; padding: 12px 14px; border: 1px solid #cfd4dc; border-radius: 10px; background: #fff;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid #bcd3ff; border-color: var(--blue); }

button {
  font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 12px 18px; cursor: pointer;
  background: var(--blue); color: #fff; min-height: 46px;
}
button:hover { background: var(--blue-dark); }
button:disabled { background: #aab3c2; cursor: default; }
button.ghost { background: #fff; color: var(--ink); border: 1px solid #cfd4dc; }
button.ghost:hover { background: #f0f2f5; }
button.danger { background: #fff; color: var(--warn); border: 1px solid #f2b8b5; }
button.danger:hover { background: var(--warn-bg); }
button.tiny { min-height: 0; padding: 6px 10px; font-size: .85rem; }

.notice { background: #fff8e1; border: 1px solid #f3d27a; border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; }
.notice.danger { background: var(--warn-bg); border-color: #f2b8b5; }

/* 아이 화면 */
.question { font-size: 1.35rem; font-weight: 700; margin: 8px 0 4px; }
.rules { background: #eef4ff; border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; }
.rules strong { display: block; margin-bottom: 4px; }
.rules ol { margin: 4px 0 4px 1.2em; padding: 0; }
.colors { display: flex; gap: 10px; margin: 10px 0; }
.colors label { margin: 0; }
.colors input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dot { display: inline-block; width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.colors input:checked + .dot { border-color: var(--ink); }
.colors input:focus-visible + .dot { outline: 3px solid #bcd3ff; }
.counter { text-align: right; font-size: .85rem; color: var(--sub); }
.code-input { font-size: 1.8rem; letter-spacing: .3em; text-align: center; text-transform: uppercase; }

/* 포스트잇 */
.notes { columns: 1; column-gap: 14px; margin-top: 10px; }
.note {
  break-inside: avoid; border-radius: 6px 6px 14px 6px; padding: 14px 16px; margin: 0 0 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,.08); font-size: 1.05rem; white-space: pre-wrap;
}
.note .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: .8rem; color: #5d5a4a; gap: 8px; }
.note.yellow { background: var(--note-yellow); }
.note.pink { background: var(--note-pink); }
.note.blue { background: var(--note-blue); }
.note.green { background: var(--note-green); }
.dot.yellow { background: var(--note-yellow); }
.dot.pink { background: var(--note-pink); }
.dot.blue { background: var(--note-blue); }
.dot.green { background: var(--note-green); }

/* 선생님 큰 화면 */
.board-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; }
.board-head .question { font-size: 2rem; line-height: 1.35; }
.join { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.join img { width: 170px; height: 170px; image-rendering: pixelated; display: block; margin: 0 auto 6px; }
.join .code { font-size: 1.8rem; font-weight: 800; letter-spacing: .18em; }
.wide .notes { columns: 4 260px; }
.wide .note { font-size: 1.3rem; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.badge { display: inline-block; font-size: .8rem; padding: 2px 8px; border-radius: 99px; background: #eef1f5; color: var(--sub); }
.badge.open { background: var(--ok-bg); color: var(--ok); }

/* 점검 화면 */
.test { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.test:first-of-type { border-top: 0; }
.test .what { font-weight: 600; }
.result { grid-column: 1 / -1; border-radius: 10px; padding: 10px 12px; display: none; }
.result.show { display: block; }
.result.blocked { background: var(--ok-bg); color: var(--ok); }
.result.open { background: var(--warn-bg); color: var(--warn); }
.result.skip { background: #eef1f5; color: var(--sub); }
.result code { font-size: .8rem; color: inherit; opacity: .8; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 99px; transition: .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hidden { display: none !important; }

@media (min-width: 700px) {
  main:not(.wide) .notes { columns: 2; }
}
@media (max-width: 700px) {
  .board-head { grid-template-columns: 1fr; }
  .board-head .question { font-size: 1.4rem; }
}
