* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Pretendard", "Malgun Gothic", sans-serif;
  background: #f4f6f8;
  color: #222;
}

.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 32px;
  width: 100%;
  max-width: 420px;
}

.card h1 {
  font-size: 22px;
  margin-bottom: 8px;
}

.card p.subtitle {
  color: #666;
  margin-top: 0;
  margin-bottom: 24px;
  font-size: 14px;
}

.tabs {
  display: flex;
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ddd;
}

.tabs button {
  flex: 1;
  padding: 10px;
  border: none;
  background: #f0f0f0;
  cursor: pointer;
  font-size: 14px;
}

.tabs button.active {
  background: #2563eb;
  color: #fff;
}

label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: #444;
}

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 15px;
}

button.primary {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

button.primary:hover { background: #1d4ed8; }

button.secondary {
  padding: 10px 16px;
  border: 1px solid #2563eb;
  border-radius: 8px;
  background: #fff;
  color: #2563eb;
  cursor: pointer;
  font-size: 14px;
}

.error-msg {
  color: #d33;
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}

.turnstile-wrap {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

/* 수업 화면 레이아웃 */
.classroom-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: #1e293b;
  color: #fff;
  font-size: 14px;
}

.top-bar .room-name { font-weight: 600; }
.top-bar .user-info { opacity: 0.85; }

.top-bar button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.5);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.split {
  flex: 1;
  display: flex;
  min-height: 0;
}

.pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #ddd;
}

.pane:last-child { border-right: none; }

.pane-header {
  padding: 8px 14px;
  background: #eef1f5;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pane-body { flex: 1; min-height: 0; }
.pane-body iframe, .pane-body #ggb-element {
  width: 100%;
  height: 100%;
  border: none;
}

button.capture-btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #2563eb;
  background: #fff;
  color: #2563eb;
  cursor: pointer;
}

.hint {
  font-size: 12px;
  color: #666;
  padding: 6px 14px;
  background: #fffbe6;
  border-top: 1px solid #f0e6b8;
}

.pane-toggle {
  display: none;
}

.pane-toggle .toggle-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: #eef1f5;
  color: #333;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.pane-toggle .toggle-btn.active {
  background: #fff;
  border-bottom-color: #2563eb;
  font-weight: 600;
  color: #2563eb;
}

@media (max-width: 860px) {
  .pane-toggle { display: flex; }

  .split { position: relative; }
  .split .pane { border-right: none; border-bottom: none; }

  /* 기본: GeoGebra 화면만 전체 높이로 표시, Padlet은 숨김 */
  .split .pane[data-pane="padlet"] { display: none; }

  /* 토론 보드 탭 선택 시: Padlet만 전체 높이로 표시, GeoGebra는 숨김 */
  .split.show-padlet .pane[data-pane="ggb"] { display: none; }
  .split.show-padlet .pane[data-pane="padlet"] { display: flex; }
}

/* 교사 대시보드 */
.dashboard {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 16px;
}

.dashboard h1 { font-size: 22px; }

.room-form {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 24px;
}

table.room-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

table.room-table th, table.room-table td {
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid #eee;
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.badge.active { background: #dcfce7; color: #166534; }
.badge.ended { background: #f1f1f1; color: #888; }

.code-pill {
  font-family: monospace;
  font-size: 15px;
  background: #eef1f5;
  padding: 2px 8px;
  border-radius: 6px;
}

.link-btn {
  background: none;
  border: none;
  color: #2563eb;
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  padding: 0;
}
