* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f1117;
  color: #e0e0e0;
  height: 100vh;
  height: 100dvh; /* 패드·폰 주소창에 아래가 가리지 않게 */
  overflow: hidden;
}

.hidden { display: none !important; }

/* ── 로비 ── */
#lobby {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh; /* 패드·폰 주소창에 아래가 가리지 않게 */
  background: linear-gradient(135deg, #0f1117 0%, #1a1f2e 100%);
}

.lobby-box {
  background: #1e2332;
  border: 1px solid #2d3348;
  border-radius: 20px;
  padding: 48px 40px;
  width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lobby-icon {
  font-size: 48px;
  text-align: center;
}

.lobby-box h1 {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  color: #fff;
}

.lobby-box .subtitle {
  font-size: 13px;
  color: #8892a4;
  text-align: center;
  margin-bottom: 6px;
}

.lobby-box input {
  background: #252b3b;
  border: 1px solid #3a4055;
  border-radius: 10px;
  padding: 12px 16px;
  color: #e0e0e0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.lobby-box input:focus {
  border-color: #22c55e;
}

#join-btn {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none;
  border-radius: 10px;
  padding: 13px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity 0.2s, transform 0.1s;
}

#join-btn:hover { opacity: 0.9; transform: translateY(-1px); }
#join-btn:active { transform: translateY(0); }

.lobby-info {
  color: #c5cde0;
  font-size: 14px;
  text-align: center;
  line-height: 1.6;
}
#join-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.error-msg {
  color: #ff6b6b;
  font-size: 13px;
  text-align: center;
  min-height: 18px;
}

/* ── 방 레이아웃 ── */
#room {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* 패드·폰 주소창에 아래가 가리지 않게 */
}

.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #141824;
  border-bottom: 1px solid #252b3b;
  flex-shrink: 0;
  height: 50px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
}

.room-icon { font-size: 18px; }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.status-badge.waiting { background: #2a2d3e; color: #8892a4; }
.status-badge.connected { background: #1a3a2a; color: #4caf7d; }

.copy-link-btn {
  background: #1e2332;
  border: 1px solid #3a4055;
  color: #c5cde0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.copy-link-btn:hover { background: #252b3b; }

.copy-link-btn.copied {
  background: #1a3a2a;
  border-color: #4caf7d;
  color: #4caf7d;
}

.record-btn {
  background: #1e2332;
  border: 1px solid #3a4055;
  color: #c5cde0;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.record-btn:hover { background: #252b3b; }

.record-btn.recording {
  background: #3a1a1a;
  border-color: #e74c3c;
  color: #e74c3c;
}

.rec-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #e74c3c;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e74c3c;
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.leave-btn {
  background: #3a1a1a;
  border: 1px solid #5a2a2a;
  color: #ff6b6b;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.leave-btn:hover { background: #4a2020; }

/* ── 설정 모달 ── */
.settings-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.settings-box {
  background: #1e2332;
  border: 1px solid #3a4055;
  border-radius: 16px;
  width: 320px;
  max-height: 80vh;
  overflow: hidden;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #2d3348;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
}

.settings-close-btn {
  background: none;
  border: none;
  color: #8892a4;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
  line-height: 1;
}
.settings-close-btn:hover { background: #2d3555; color: #fff; }

.settings-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #2d3348;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-row label {
  width: 40px;
  font-size: 13px;
  color: #8892a4;
  flex-shrink: 0;
}

.settings-select {
  flex: 1;
  min-width: 0;
  background: #252b3b;
  border: 1px solid #3a4055;
  color: #e0e0e0;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-select:focus { border-color: #22c55e; }

.settings-toggle {
  padding: 5px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.settings-toggle.on  { background: #1a3a2a; border-color: #4caf7d; color: #4caf7d; }
.settings-toggle.off { background: #3a1a1a; border-color: #e74c3c; color: #e74c3c; }

.settings-range {
  flex: 1;
  accent-color: #22c55e;
  cursor: pointer;
}

.settings-range-val {
  font-size: 13px;
  color: #8892a4;
  width: 44px;
  text-align: right;
  flex-shrink: 0;
}

.remote-settings-hint {
  font-size: 12px;
  color: #8892a4;
  text-align: center;
  padding: 4px 0 0;
}

.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── 왼쪽 비디오 패널 ── */
.video-panel {
  width: 240px;
  flex-shrink: 0;
  background: #141824;
  border-right: 1px solid #252b3b;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.video-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}

.video-box {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #0a0c14;
  border: 1px solid #252b3b;
}

.remote-box {
  height: 160px;
}

.local-box {
  height: 120px;
}

.video-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-label {
  position: absolute;
  bottom: 6px;
  left: 8px;
  font-size: 11px;
  color: #fff;
  background: rgba(0,0,0,0.55);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.remote-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.remote-ctrl-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.remote-ctrl-btn:hover { background: rgba(255,255,255,0.22); }
.remote-ctrl-btn.muted  { background: rgba(239,68,68,0.5); }

.remote-vol-icon { font-size: 13px; flex-shrink: 0; }

.remote-vol-slider {
  flex: 1;
  height: 4px;
  accent-color: #22c55e;
  cursor: pointer;
  min-width: 0;
}

.remote-vol-display {
  font-size: 10px;
  color: #aaa;
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

.waiting-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0d1018;
  gap: 8px;
}

.waiting-icon { font-size: 32px; opacity: 0.5; }
.waiting-overlay p { font-size: 12px; color: #6b7280; }

.video-controls {
  display: flex;
  gap: 8px;
  padding: 8px;
}

.ctrl-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  background: #1e2332;
  border: 1px solid #2d3348;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  color: #e0e0e0;
}

.ctrl-btn:hover { background: #252b3b; }
.ctrl-btn.off { background: #3a1a1a; border-color: #5a2a2a; color: #ff6b6b; }

.btn-icon { font-size: 18px; }
.btn-label { font-size: 10px; color: #8892a4; }

/* 채팅 */
.chat-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  border-top: 1px solid #252b3b;
}

.chat-title {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #8892a4;
  border-bottom: 1px solid #252b3b;
  flex-shrink: 0;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#chat-messages::-webkit-scrollbar { width: 4px; }
#chat-messages::-webkit-scrollbar-track { background: transparent; }
#chat-messages::-webkit-scrollbar-thumb { background: #3a4055; border-radius: 2px; }

.chat-msg {
  font-size: 12px;
  line-height: 1.4;
}

.chat-msg .msg-meta {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 2px;
}

.msg-name {
  font-weight: 700;
  color: #7c9fff;
  font-size: 11px;
}

.msg-name.mine { color: #7cffa0; }

.msg-time {
  font-size: 10px;
  color: #4b5268;
}

.msg-body {
  background: #1e2332;
  border-radius: 8px;
  padding: 5px 9px;
  color: #c5cde0;
  word-break: break-word;
}

.chat-msg.system-msg .msg-body {
  background: transparent;
  color: #6b7280;
  font-size: 11px;
  font-style: italic;
  padding: 2px 0;
}

.chat-input-row {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid #252b3b;
  flex-shrink: 0;
}

.chat-input-row input {
  flex: 1;
  background: #252b3b;
  border: 1px solid #3a4055;
  border-radius: 8px;
  padding: 7px 10px;
  color: #e0e0e0;
  font-size: 12px;
  outline: none;
}

.chat-input-row input:focus { border-color: #22c55e; }

#send-btn {
  background: #22c55e;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

#send-btn:hover { background: #4a6ee0; }

/* ── 화이트보드 패널 ── */
.board-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #1a1f2e;
}

#wb-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #141824;
  border-top: 1px solid #252b3b;
  flex-shrink: 0;
  height: 46px;
}

.mode-tabs {
  display: flex;
  gap: 4px;
}

.mode-tab {
  padding: 6px 16px;
  border-radius: 8px;
  border: 1px solid #3a4055;
  background: #1e2332;
  color: #8892a4;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mode-tab:hover { background: #252b3b; color: #c5cde0; }

.mode-tab.active {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
  font-weight: 600;
}

.clear-all-btn {
  background: #3a1a1a;
  border: 1px solid #5a2a2a;
  color: #ff8080;
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.clear-all-btn:hover { background: #4a2020; }

/* 툴바 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: #141824;
  border-bottom: 1px solid #252b3b;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-label {
  font-size: 11px;
  color: #8892a4;
}

.tool-btn {
  background: #1e2332;
  border: 1px solid #3a4055;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
}

.tool-btn:hover { background: #252b3b; }
.tool-btn.active { background: #22c55e; border-color: #22c55e; }

.action-btn {
  background: #1e2332;
  border: 1px solid #3a4055;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: #c5cde0;
  cursor: pointer;
  transition: background 0.15s;
}

.action-btn:hover { background: #252b3b; }

#color-picker {
  width: 34px;
  height: 30px;
  padding: 2px;
  border: 1px solid #3a4055;
  border-radius: 8px;
  background: #1e2332;
  cursor: pointer;
}

#size-slider {
  width: 80px;
  accent-color: #22c55e;
}

#size-display {
  font-size: 12px;
  color: #8892a4;
  min-width: 20px;
  text-align: center;
}

.nav-btn {
  background: #1e2332;
  border: 1px solid #3a4055;
  border-radius: 6px;
  padding: 4px 10px;
  color: #c5cde0;
  cursor: pointer;
  font-size: 12px;
}

.nav-btn:hover { background: #252b3b; }

#pdf-page-info {
  font-size: 12px;
  color: #8892a4;
  min-width: 50px;
  text-align: center;
}

/* ── 오른쪽 페이지 목록 패널 ── */
.pages-panel {
  width: 72px;
  flex-shrink: 0;
  background: #141824;
  border-left: 1px solid #252b3b;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pages-header {
  padding: 8px 0;
  font-size: 11px;
  font-weight: 600;
  color: #8892a4;
  text-align: center;
  border-bottom: 1px solid #252b3b;
  flex-shrink: 0;
}

.pages-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.pages-list::-webkit-scrollbar { width: 3px; }
.pages-list::-webkit-scrollbar-track { background: transparent; }
.pages-list::-webkit-scrollbar-thumb { background: #3a4055; border-radius: 2px; }

.page-num-btn {
  width: 44px;
  height: 34px;
  border: 1px solid #2d3348;
  border-radius: 7px;
  background: #1e2332;
  color: #8892a4;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.page-num-btn:hover {
  background: #252b3b;
  color: #c5cde0;
  border-color: #3a4055;
}

.page-num-btn.active {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
  font-weight: 700;
}

/* ── 캔버스 ── */
.canvas-container {
  flex: 1;
  overflow: auto;
  background: #d0d0d0;
  position: relative;
}

#canvas-wrapper {
  min-width: 100%;
  min-height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

#canvas-inner {
  position: relative;
  transform-origin: 0 0;
  flex-shrink: 0;
  background: #ffffff;
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}

#pdf-canvas {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
}

#draw-canvas {
  display: block;
  cursor: crosshair;
  position: relative;
  touch-action: none;
}

#preview-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* ── 도형 선택 팝업 ── */
.shape-wrap {
  position: relative;
}

.tool-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #1e2332;
  border: 1px solid #3a4055;
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

#shape-popup {
  width: calc(34px * 3 + 4px * 2 + 6px * 2);
}

.shape-opt, .pen-opt {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0;
  width: 34px;
  height: 34px;
  color: #c5cde0;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.shape-opt:hover, .pen-opt:hover { background: #2d3555; }
.shape-opt.active, .pen-opt.active { background: #22c55e; color: #fff; border-color: #22c55e; }

.color-swatches {
  display: flex;
  align-items: center;
  gap: 5px;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  cursor: pointer;
  transition: transform 0.12s;
  padding: 0;
  flex-shrink: 0;
}

.color-swatch:hover { transform: scale(1.2); }

.color-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px #22c55e;
}

.zoom-indicator {
  position: absolute;
  bottom: 14px;
  right: 18px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 10;
}

.zoom-indicator.hidden { opacity: 0; }

/* ── 모바일 채팅 토글 버튼 (데스크탑에서 숨김) ── */
.chat-toggle-btn {
  display: none;
  background: #1e2332;
  border: 1px solid #3a4055;
  color: #c5cde0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}

.chat-mobile-close {
  display: none;
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #8892a4;
  font-size: 18px;
  cursor: pointer;
  z-index: 1;
  line-height: 1;
}

/* ════════════════════════════════════════════
   모바일 반응형 (≤ 768px)
════════════════════════════════════════════ */
/* 폰, 그리고 세로로 든 패드: 캠을 위 가로 띠로 올려 보드를 넓게 */
@media (max-width: 768px), (orientation: portrait) and (pointer: coarse) {

  body { overflow: hidden; }

  /* 헤더 압축 */
  .room-header { padding: 6px 10px; gap: 5px; }
  #room-title  { font-size: 13px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .copy-link-btn { display: none; }
  .chat-toggle-btn { display: flex; align-items: center; }

  /* 메인 레이아웃: 세로 방향 */
  .main-layout { flex-direction: column; }

  /* 비디오 패널 → 상단 가로 띠 */
  .video-panel {
    width: 100%;
    flex-direction: row;
    flex-shrink: 0;
    height: 120px;
    border-right: none;
    border-bottom: 1px solid #252b3b;
  }

  .video-section {
    flex-direction: row;
    flex: 1;
    padding: 4px;
    gap: 4px;
  }

  .remote-box { height: 100%; flex: 3; width: auto; }
  .local-box  { height: 100%; flex: 2; width: auto; }

  .video-controls {
    flex-direction: column;
    width: 46px;
    justify-content: center;
    padding: 4px 2px;
    gap: 4px;
    border-top: none;
    border-left: 1px solid #252b3b;
  }

  .ctrl-btn   { flex-direction: column; padding: 6px 2px; }
  .btn-label  { display: none; }
  .btn-icon   { font-size: 20px; }

  /* 채팅: 숨김 → 하단 슬라이드 오버레이 */
  .chat-section {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 55vh;
    z-index: 150;
    background: #1a1f2e;
    border-top: 2px solid #3a4055;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
    padding-top: 8px;
    flex-direction: column;
  }
  .chat-section.mobile-open { display: flex; }
  .chat-mobile-close { display: block; }

  /* 보드 패널: 남은 공간 */
  .board-panel { flex: 1; min-height: 0; }

  /* 페이지 패널: 숨김 */
  .pages-panel { display: none !important; }

  /* 툴바 */
  .toolbar { flex-wrap: wrap; padding: 4px 6px; gap: 4px; }
  .tool-btn { width: 32px; height: 32px; font-size: 15px; }
  .action-btn { padding: 5px 8px; font-size: 11px; }
  .tool-label { font-size: 11px; }
  #size-display { font-size: 11px; }

  /* 모드 탭 */
  .mode-tab { padding: 6px 10px; font-size: 12px; }
  .clear-all-btn { padding: 6px 10px; font-size: 12px; }

  /* 설정 모달 */
  .settings-box { width: calc(100vw - 32px); }
}

/* ── 지난 수업 다시 보기 (보기 전용) ── */
.export-pdf-btn { display: none; }
.review-mode .export-pdf-btn { display: inline-block; }
.review-mode .video-panel,
.review-mode #connection-status,
.review-mode #chat-toggle-btn,
.review-mode #record-btn,
.review-mode #rec-indicator,
.review-mode #leave-btn,
.review-mode .mode-bar,
.review-mode .toolbar .tool-group:not(.pdf-nav) { display: none !important; }
.review-mode #draw-canvas { cursor: default !important; }

/* ── 화면 공유 보기 ── */
#screen-content {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}
#screen-view { width: 100%; height: 100%; object-fit: contain; }
.screen-empty { position: absolute; color: #8892a4; font-size: 14px; }
.ctrl-btn.active { background: #14532d; border-color: #22c55e; color: #86efac; }

/* ── 상대방 녹화 중 표시 ── */
.remote-rec-banner {
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #3a1a1a;
  color: #ff6b6b;
  font-size: 12px;
  font-weight: 600;
}

/* 펜·터치로 그릴 때 페이지가 스크롤·확대되지 않도록 */
#draw-canvas { touch-action: none; }

/* ── 아이콘 (index.html 스프라이트) ── */
.icon-sprite { display: none; }
.ic {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
  flex-shrink: 0;
}
.lobby-icon .ic { width: 40px; height: 40px; color: #22c55e; }
.tool-btn .ic, .chat-toggle-btn .ic, .remote-ctrl-btn .ic { width: 1.25em; height: 1.25em; vertical-align: -0.3em; }
.btn-icon .ic { width: 20px; height: 20px; }

/* ── 대기 화면: 학생에게 알림톡 보내기 ── */
/* 영상 칸이 낮아서 버튼이 보일 땐 아이콘을 숨겨 자리 확보 */
.waiting-overlay:has(.notify-btn:not(.hidden)) .waiting-icon { display: none; }
.notify-btn {
  margin-top: 2px;
  padding: 6px 12px;
  border: 1px solid #22c55e;
  border-radius: 8px;
  background: transparent;
  color: #86efac;
  font-size: 12px;
  cursor: pointer;
}
.notify-btn:hover { background: #14532d; }
.notify-btn:disabled { opacity: 0.5; cursor: default; }
.notify-msg { margin-top: 0; font-size: 11px; color: #8892a4; min-height: 14px; }

/* 패드에서 펜슬을 오래 눌러도 글자 선택·복사 메뉴가 뜨지 않게 (입력칸은 제외) */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }

.nocam-retry { margin-top: 4px; padding: 4px 10px; border: 1px solid #22c55e; border-radius: 6px; background: transparent; color: #86efac; font-size: 11px; cursor: pointer; }

/* 터치 기기: 손가락·펜슬로 누르기 쉽게 버튼을 키움 */
@media (pointer: coarse) {
  .color-swatch { width: 32px; height: 32px; }
  .tool-btn { min-width: 44px; min-height: 40px; }
  .action-btn, .nav-btn { min-height: 40px; }
  #size-slider { width: 110px; height: 32px; }
}

/* ── 수업 기록 창 ── */
.lesson-note-box { width: 400px; max-width: calc(100vw - 32px); }
.lesson-note-box .settings-body { padding: 16px 20px; }
.lesson-note-text {
  width: 100%;
  box-sizing: border-box;
  background: #0f1117;
  border: 1px solid #3a4055;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 14px;
  font-family: inherit;
  padding: 10px;
  resize: vertical;
}
.lesson-note-text:focus { outline: none; border-color: #22c55e; }
.lesson-note-hint { font-size: 11px; color: #8892a4; margin-top: 6px; }
.lesson-note-msg { font-size: 12px; color: #fbbf24; min-height: 16px; margin-top: 4px; }
.lesson-note-actions { display: flex; gap: 8px; margin-top: 8px; }
.lesson-note-skip, .lesson-note-save { flex: 1; padding: 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.lesson-note-skip { background: transparent; border: 1px solid #3a4055; color: #c5cde0; }
.lesson-note-save { background: #16a34a; border: none; color: #fff; font-weight: 600; }
.lesson-note-save:disabled { opacity: 0.5; cursor: default; }
