:root {
  /* Lyu LaBo 시그니처 — 먹색(墨) · 원목 · 라이트베이지 */
  --ink: #1c1914;        /* 먹색: 주 액션·텍스트 강조 */
  --ink-soft: #35302a;
  --wood: #8a6a48;       /* 원목: 포인트·하이라이트 */
  --wood-deep: #5c4732;
  --bg: #f2ede4;         /* 라이트베이지 바탕 */
  --card: #fbf9f4;
  --text: #26221c;
  --muted: #8f8779;
  --line: #e3dbcc;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, .logo, #room-title, #d-title { font-family: "Noto Serif KR", Georgia, serif; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px; background: var(--ink); color: #efe9dd;
  border-bottom: 3px solid var(--wood);
}
.topbar .logo {
  font-weight: 800; font-size: 1.15rem; letter-spacing: .06em;
}
.topbar .logo small { font-family: inherit; font-weight: 400; opacity: .6; margin-left: 8px; letter-spacing: .02em; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .85rem; opacity: .85; }
.topbar button { background: rgba(255,255,255,.1); color: #efe9dd; border: 1px solid rgba(255,255,255,.2); }
.topbar a { color: #efe9dd; }

main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 80px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
}
h1 { font-size: 1.4rem; } h2 { font-size: 1.05rem; margin: 0 0 12px; letter-spacing: .01em; }
h3 { font-size: .95rem; margin: 16px 0 8px; }
.muted { color: var(--muted); font-size: .85rem; }
button {
  background: var(--ink); color: #f3eee5; border: 0; border-radius: 9px;
  padding: 9px 16px; font-size: .92rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
button:hover { background: var(--wood-deep); }
button.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
button.ghost:hover { background: var(--ink); color: #f3eee5; }
button.small { padding: 5px 10px; font-size: .8rem; }
button:disabled { opacity: .4; cursor: default; }
input, select, textarea {
  font-family: inherit; font-size: .95rem; padding: 9px 12px; color: var(--text);
  border: 1.5px solid var(--line); border-radius: 9px; background: #fff; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--wood); border-color: transparent; }
.row { display: flex; gap: 8px; align-items: center; }
.row > input { flex: 1; }
.hidden { display: none !important; }
.error { color: #a03b2e; font-size: .85rem; margin-top: 6px; min-height: 1.2em; }
.ok { color: #4c6b45; }

/* ---- 강의실 ---- */
.classroom {
  background: linear-gradient(180deg, #f7f3ea, #efe8da);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.podium {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--ink-soft); color: #efe9dd; border-radius: 10px; padding: 10px; margin-bottom: 22px;
  min-height: 56px; border-bottom: 3px solid var(--wood);
}
.pod-name { font-weight: 700; } .pod-empty { opacity: .55; font-size: .85rem; }
.desks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 10px; }
@media (min-width: 720px) { .desks { grid-template-columns: repeat(6, 1fr); } }
.desk {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px 8px; background: #fdfbf6; border: 1px solid var(--line); border-radius: 12px;
  min-height: 86px; box-shadow: 0 1px 0 rgba(28,25,20,.05);
}
.desk:not(.occupied) { opacity: .38; background: transparent; border-style: dashed; box-shadow: none; }
.char {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; font-size: 24px;
}
.char.empty { background: transparent; color: var(--muted); }
.nick { font-size: .74rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble-slot { position: absolute; top: -8px; left: 50%; width: 0; }
.bubble {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); border: 0; color: #f3eee5;
  padding: 7px 11px; border-radius: 12px; font-size: .8rem; width: max-content; max-width: 200px;
  box-shadow: 0 6px 18px rgba(28,25,20,.25); z-index: 30; animation: pop .18s ease-out;
}
.bubble::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--ink);
}
.podium .bubble { bottom: calc(100% + 4px); }
@keyframes pop { from { transform: translateX(-50%) scale(.7); opacity: 0; } }
.emote-float {
  position: absolute; top: 0; left: 50%; font-size: 22px; z-index: 20;
  animation: rise 1.5s ease-out forwards;
}
@keyframes rise { to { transform: translateY(-46px); opacity: 0; } }
.presence-line { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: .85rem; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c2b9a8; }
.dot.on { background: #5f7d55; }

/* ---- 활동 ---- */
.activity-panel { border: 2px solid var(--ink); }
.option-btn {
  display: block; width: 100%; text-align: left; margin: 6px 0;
  background: #fff; color: var(--text); border: 1.5px solid var(--line);
}
.option-btn:hover { background: #f4efe5; border-color: var(--wood); }
.option-btn.selected { background: var(--ink); color: #f3eee5; border-color: var(--ink); }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; }
.bar-label { width: 32%; font-size: .85rem; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; background: #e9e2d3; border-radius: 6px; height: 22px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--wood-deep), var(--wood)); border-radius: 6px; transition: width .4s; min-width: 2px; }
.bar-count { width: 34px; font-size: .85rem; font-weight: 700; }
.cloud-box { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: baseline; justify-content: center; padding: 18px 6px; }
.cloud-word { font-weight: 700; }

/* ---- 화이트보드 ---- */
.board-wrap { position: relative; background: #fdfcf8; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.board-wrap canvas { display: block; width: 100%; touch-action: none; }
.board-tools { display: flex; gap: 6px; margin: 8px 0; align-items: center; }
.pen-btn { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.pen-btn.active { border-color: var(--wood); outline: 2px solid var(--wood); }

/* ---- 목록·표 ---- */
table { border-collapse: collapse; width: 100%; font-size: .87rem; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .78rem; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.pill.live { background: #e6ead9; color: #4c6b45; }
.pill.draft { background: #ece6d9; color: var(--muted); }
.pill.closed { background: #e6ddd2; color: #8a6a48; }
.pill.kind { background: var(--ink); color: #f3eee5; }
.pill.kind.program { background: var(--wood); }
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { background: transparent; color: var(--muted); border-radius: 9px 9px 0 0; }
.tabs button.active { background: var(--ink); color: #f3eee5; }
.join-code { font-family: ui-monospace, monospace; font-size: 1.3rem; font-weight: 800; letter-spacing: .18em; color: var(--wood-deep); }
.emote-bar { display: flex; gap: 6px; margin-top: 8px; }
.emote-bar button { background: #fff; border: 1px solid var(--line); font-size: 1.1rem; padding: 5px 9px; }
.qna-log { max-height: 260px; overflow-y: auto; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 10px; }
legend { font-size: .8rem; color: var(--muted); padding: 0 6px; }
.leaderboard-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.leaderboard-row .rank { width: 26px; font-weight: 800; color: var(--wood-deep); }
