/* ============================================================
   디지털 기초 미션 — 공통 스타일
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

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

body {
  font-family: 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  background: #F8F8F6;
  color: #1F2937;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 17px;
}

/* ── 통일 상단바 ── */
.nj-topbar {
  position: sticky; top: 0; z-index: 100;
  max-width: 100vw; overflow-x: auto; scrollbar-width: none;
  display: flex; align-items: center; gap: 18px;
  padding: 10px max(24px, calc((100vw - 1160px) / 2));
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid #E5E7EB;
}
.nj-topbar::-webkit-scrollbar { display: none; }
.nj-topbar .nbrand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: #111827; }
.nj-topbar .nbrand img { width: 30px; height: 30px; }
.nj-topbar .nbrand .nname { font-size: 1rem; font-weight: 900; letter-spacing: -.01em; white-space: nowrap; }
.nj-topbar .nbrand .nname span { color: #2563EB; }
.nj-nav2 { display: flex; gap: 2px; margin-left: 6px; }
.nj-nav2 a {
  text-decoration: none; color: #6B7280; font-size: .88rem; font-weight: 600;
  padding: 6px 12px; border-radius: 8px; transition: background .15s, color .15s; white-space: nowrap;
}
.nj-nav2 a:hover { background: #F5F7FA; color: #111827; }
.nj-nav2 a.on { background: #EFF6FF; color: #2563EB; font-weight: 800; }
.nj-cta2 {
  margin-left: auto; text-decoration: none; background: #2563EB; color: #fff;
  font-size: .8rem; font-weight: 800; padding: 8px 16px; border-radius: 50px; white-space: nowrap;
}
.nj-cta2:hover { background: #1D4ED8; }
@media (max-width: 640px) { .nj-cta2 { display: none; } }

.back-link {
  display: inline-flex; align-items: center; gap: 6px; color: #64748B; text-decoration: none;
  font-size: .9rem; font-weight: 600; margin: 16px 0 0 max(24px, calc((100vw - 900px) / 2));
}
.back-link:hover { color: #2563EB; }

/* ── 미션 페이지 공통 레이아웃 ── */
.m-head { text-align: center; padding: 20px 20px 6px; }
.m-head .m-no {
  display: inline-block; background: #EFF6FF; color: #2563EB; border: 1px solid #BFDBFE;
  font-size: .8rem; font-weight: 800; padding: 3px 14px; border-radius: 20px; letter-spacing: .05em;
}
.m-head h1 { font-size: 1.75rem; font-weight: 900; margin-top: 10px; word-break: keep-all; }
.m-head .m-sub { color: #6B7280; margin-top: 6px; font-size: .98rem; word-break: keep-all; }

main.m-main { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 14px 18px 60px; }

/* 진행 점 */
.dots { display: flex; justify-content: center; gap: 8px; margin: 14px 0 22px; }
.dots span { width: 12px; height: 12px; border-radius: 50%; background: #E5E7EB; transition: background .2s, transform .2s; }
.dots span.on { background: #2563EB; transform: scale(1.25); }
.dots span.done { background: #86EFAC; }

/* 과제 배너 — 지금 할 일 */
.task {
  background: #FFFBEB; border: 2px solid #FDE68A; border-radius: 14px;
  padding: 16px 20px; margin-bottom: 20px;
  font-size: 1.12rem; font-weight: 700; line-height: 1.6; word-break: keep-all;
}
.task .t-label { display: block; font-size: .78rem; font-weight: 800; color: #D97706; letter-spacing: .08em; margin-bottom: 4px; }
.task .kbd { font-size: .95em; }

/* 피드백 */
.fb { border-radius: 12px; padding: 13px 18px; margin: 14px 0; font-weight: 700; line-height: 1.6; word-break: keep-all; display: none; }
.fb.show { display: block; animation: fbIn .25s ease; }
.fb.good { background: #F0FDF4; border: 2px solid #86EFAC; color: #15803D; }
.fb.bad  { background: #FEF2F2; border: 2px solid #FECACA; color: #B91C1C; }
.fb.info { background: #EFF6FF; border: 2px solid #BFDBFE; color: #1D4ED8; }
@keyframes fbIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* 개념 카드 */
.concept {
  background: #fff; border: 1px solid #E5E7EB; border-radius: 16px;
  padding: 26px 24px; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,.05);
}
.concept h2 { font-size: 1.3rem; font-weight: 900; margin-bottom: 12px; word-break: keep-all; }
.concept p { color: #4B5563; line-height: 1.8; word-break: keep-all; }
.concept .big-emoji { font-size: 3rem; line-height: 1; margin-bottom: 14px; }

/* 키보드 키 표시 */
.kbd {
  display: inline-block; padding: 4px 13px; border-radius: 8px; background: #fff;
  border: 1px solid #CBD5E1; border-bottom: 3px solid #94A3B8;
  font-weight: 800; font-size: .92rem; color: #1F2937; margin: 0 2px; white-space: nowrap;
}
.kbd-big { font-size: 1.3rem; padding: 12px 26px; border-radius: 12px; border-bottom-width: 4px; }
.kbd-plus { font-weight: 900; color: #9CA3AF; margin: 0 6px; }

/* 버튼 */
.btn {
  display: inline-block; border: none; cursor: pointer; text-decoration: none;
  background: #2563EB; color: #fff; font-family: inherit;
  font-size: 1.05rem; font-weight: 800; padding: 13px 34px; border-radius: 12px;
  transition: background .15s, transform .1s;
}
.btn:hover { background: #1D4ED8; }
.btn:active { transform: scale(.97); }
.btn.green { background: #16A34A; }
.btn.green:hover { background: #15803D; }
.btn.ghost { background: #fff; color: #374151; border: 1px solid #D1D5DB; }
.btn.ghost:hover { background: #F9FAFB; }

/* ── 가짜 브라우저 ── */
.sim {
  border: 1px solid #D1D5DB; border-radius: 14px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.10); background: #fff; user-select: none;
}
.sim-tabs { display: flex; align-items: flex-end; background: #DFE3E8; padding: 8px 10px 0; gap: 2px; }
.sim-tab {
  display: flex; align-items: center; gap: 8px;
  background: #EAECEF; color: #374151; border-radius: 10px 10px 0 0;
  padding: 9px 14px; font-size: .9rem; cursor: pointer; white-space: nowrap;
  max-width: 200px; overflow: hidden; border: none; font-family: inherit;
}
.sim-tab .tx { border: none; background: transparent; cursor: pointer; color: #9CA3AF; font-size: .95rem; font-weight: 700; padding: 0 2px; font-family: inherit; border-radius: 50%; }
.sim-tab .tx:hover { color: #374151; background: #D1D5DB; }
.sim-tab.on { background: #fff; font-weight: 700; }
.sim-newtab {
  border: none; background: transparent; font-size: 1.35rem; line-height: 1;
  cursor: pointer; padding: 6px 12px 10px; color: #4B5563; border-radius: 8px 8px 0 0; font-family: inherit;
}
.sim-newtab:hover { background: #EAECEF; }
.sim-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fff; border-bottom: 1px solid #E5E7EB; }
.sim-url { flex: 1; background: #F1F3F4; border-radius: 20px; padding: 7px 16px; font-size: .85rem; color: #4B5563; overflow: hidden; white-space: nowrap; }
.sim-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: #2563EB; color: #fff; font-weight: 800; font-size: .95rem;
  display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid transparent;
}
.sim-avatar:hover { border-color: #93C5FD; }
.sim-avatar.off { background: #E5E7EB; color: #9CA3AF; }
.sim-body { min-height: 350px; position: relative; background: #fff; }

/* 시뮬레이션 안 드롭다운 */
.pop {
  position: absolute; z-index: 30; background: #fff; border: 1px solid #E5E7EB;
  border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.16); min-width: 200px;
  padding: 8px; animation: fbIn .15s ease;
}
.pop .pop-head { padding: 10px 12px; border-bottom: 1px solid #F3F4F6; font-size: .85rem; color: #6B7280; word-break: keep-all; }
.pop button {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  font-family: inherit; font-size: .95rem; font-weight: 600; color: #1F2937;
  padding: 11px 12px; border-radius: 8px; cursor: pointer;
}
.pop button:hover { background: #F3F4F6; }
.pop button.danger { color: #DC2626; }

/* 힌트 깜빡임 */
.pulse { animation: pulseAni 1.1s ease-in-out infinite; }
@keyframes pulseAni {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, .55); }
  50% { box-shadow: 0 0 0 10px rgba(249, 115, 22, 0); }
}
.shake { animation: shakeAni .35s ease; }
@keyframes shakeAni {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* 완료 화면 */
.done-panel {
  text-align: center; background: #fff; border: 2px solid #86EFAC; border-radius: 20px;
  padding: 44px 28px; box-shadow: 0 10px 32px rgba(22, 163, 74, .12);
}
.done-panel .de { font-size: 4rem; line-height: 1; }
.done-panel h2 { font-size: 1.6rem; font-weight: 900; margin: 14px 0 8px; }
.done-panel p { color: #4B5563; line-height: 1.8; word-break: keep-all; margin-bottom: 22px; }
.done-panel .btn { margin: 4px; }

/* 요약(기억하기) 카드 */
.remember {
  background: #F0F9FF; border: 1px solid #BAE6FD; border-radius: 14px;
  padding: 18px 22px; margin: 18px 0; line-height: 1.9; word-break: keep-all;
}
.remember .r-title { font-weight: 900; color: #0369A1; margin-bottom: 6px; }

.step { display: none; }
.step.on { display: block; animation: fbIn .3s ease; }

footer {
  text-align: center; padding: 14px 16px; background: #F8FAFC; border-top: 1px solid #E5E7EB;
  color: #94A3B8; font-size: .78rem; line-height: 1.6;
}
footer a { color: #94A3B8; text-decoration: none; }
footer a:hover { color: #475569; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .m-head h1 { font-size: 1.45rem; }
  .task { font-size: 1.02rem; padding: 14px 16px; }
  .sim-tab { padding: 8px 10px; font-size: .82rem; }
  .sim-url { font-size: .78rem; }
  main.m-main { padding: 10px 12px 48px; }
}
