/* MightBee — Mobile Play Client Stylesheet (mg-client.css)
   모바일 플레이 클라이언트 및 기존 about.html 모바일 규격(max-width: 480px · 100dvh) 통합 스타일시트.
   MightBee v3.1 팔레트(#FFFFFF 종이 · #111111 잉크 · #FBBF24 솔리드 허니) 정합. */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --mg-paper: #ffffff;
  --mg-surface: #f6f6f3;
  --mg-ink: #111111;
  --mg-ink-2: #4a4a47;
  --mg-ink-3: #787873;
  --mg-line: #e6e6e1;
  --mg-line-strong: #111111;
  --mg-honey: #fbbf24;
  --mg-honey-soft: #fef3c7;
  --mg-honey-ink: #784c00;
  --mg-npc-link: #7dd3fc;
  --mg-obj-link: #fcd34d;
  --mg-plr-link: #ddd6fe;
  --mg-self-link: #6ee7b7;
  --mg-danger: #e11d48;
  --mg-font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --mg-serif: "Noto Serif KR", Georgia, "Batang", serif;
}

html, body.mg-body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overflow: clip;
  overscroll-behavior: none;
  background: #0d0f14;
  color: var(--mg-ink);
  font-family: var(--mg-font);
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

button, input {
  font-family: inherit;
}

/* =========================================================
   0. 모바일 앱 고정 뷰포트 프레임 (전 해상도 max-width: 480px 엄수)
   ========================================================= */
.mg-stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
  overflow: clip;
  background: #0d0f14;
}

.mg-backdrop {
  position: fixed;
  inset: 0;
  transform: scale(1.1);
  background-size: cover;
  background-position: center;
  filter: blur(34px) brightness(0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, background-image 0.5s ease;
}
body.mg-body.in-play .mg-backdrop {
  opacity: 0.78;
}
@media (max-width: 520px) {
  .mg-backdrop { display: none; }
}

.mg-app {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  margin: 0 auto;
  background: var(--mg-paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow: clip;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 56px rgba(0, 0, 0, 0.55);
}
@media (max-width: 520px) {
  .mg-app {
    max-width: 100%;
    border: 0;
    box-shadow: none;
  }
}

.mg-view {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  overflow: clip;
}
.mg-view[hidden] {
  display: none !important;
}

/* 공통 언어 스위치 & 아이콘 버튼 */
.mg-lang {
  display: inline-flex;
  border: 1.5px solid var(--mg-line-strong);
  border-radius: 999px;
  padding: 2px;
  background: var(--mg-paper);
}
.mg-lang .lang-btn {
  min-width: 28px;
  height: 22px;
  padding: 0 5px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--mg-ink-2);
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
}
.mg-lang .lang-btn.active {
  background: var(--mg-ink);
  color: var(--mg-paper);
}

.mg-ic-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--mg-ink);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}
.mg-ic-btn:hover {
  background: var(--mg-surface);
}
.mg-ic-btn svg {
  width: 17px;
  height: 17px;
}

/* =========================================================
   1. 방 목록 뷰 (기존 cx-inbox 모바일 리스트 규격 계승 · 폴리싱)
   ========================================================= */
.mg-lobby-top {
  flex: none;
  height: 52px;
  padding: max(6px, env(safe-area-inset-top)) 14px 6px;
  border-bottom: 1px solid var(--mg-line);
  background: var(--mg-paper);
  display: flex;
  align-items: center;
  gap: 8px;
}
.mg-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.mg-brand img {
  height: 21px;
  width: auto;
  display: block;
}
.mg-lobby-top-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mg-inbox {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 12px 16px;
  -webkit-overflow-scrolling: touch;
}
.mg-inbox-head {
  padding: 0 6px 14px;
}
.mg-inbox-h1 {
  margin: 0 0 5px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.2;
  color: var(--mg-ink);
}
.mg-inbox-sub {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.52;
  color: var(--mg-ink-2);
}

.mg-room-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mg-room-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  border: 1px solid var(--mg-line);
  border-radius: 16px;
  background: var(--mg-paper);
  color: var(--mg-ink);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}
.mg-room-row:hover {
  background: #fffdf5;
  border-color: var(--mg-ink);
}
.mg-room-row:active {
  transform: scale(0.99);
}

.mg-room-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  background: #181b24;
  border: 1px solid rgba(17, 17, 17, 0.12);
  flex-shrink: 0;
}
.mg-room-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mg-room-dot {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  border: 1.5px solid #ffffff;
}

.mg-room-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mg-room-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.mg-room-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--mg-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mg-room-genre {
  font-size: 11px;
  font-weight: 700;
  color: var(--mg-ink-3);
  white-space: nowrap;
  flex-shrink: 0;
}
.mg-room-state {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--mg-surface);
  color: var(--mg-ink-2);
  font-size: 10.5px;
  font-weight: 800;
  flex-shrink: 0;
}
.mg-room-state.cont {
  background: var(--mg-honey-soft);
  color: var(--mg-honey-ink);
}
.mg-room-state.done {
  background: var(--mg-honey);
  color: var(--mg-ink);
}
.mg-room-hook {
  margin: 0;
  font-size: 13px;
  line-height: 1.46;
  color: var(--mg-ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mg-lobby-cta {
  flex: none;
  margin: 6px 12px max(12px, env(safe-area-inset-bottom));
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--mg-ink);
  background: var(--mg-paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mg-lobby-cta span {
  font-size: 13px;
  font-weight: 600;
  color: var(--mg-ink-2);
}
.mg-lobby-cta b {
  color: var(--mg-ink);
  font-weight: 800;
}
.mg-honey-btn {
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1.5px solid var(--mg-ink);
  background: var(--mg-honey);
  color: var(--mg-ink);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--mg-ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mg-honey-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

/* =========================================================
   2. 모바일 플레이 뷰 상단 3단 바 (21-game-mobile-393x852.jpg 동일 구조)
   ========================================================= */
/* Row 1: < 월드 제목 · ↻ · KO/EN · ✕ */
.mg-nav {
  flex: none;
  height: 48px;
  padding: max(4px, env(safe-area-inset-top)) 10px 4px;
  border-bottom: 1px solid var(--mg-line);
  background: var(--mg-paper);
  display: flex;
  align-items: center;
  gap: 6px;
}
.mg-nav-back {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--mg-ink);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}
.mg-nav-back:hover {
  background: var(--mg-surface);
}
.mg-nav-back svg {
  width: 19px;
  height: 19px;
}
.mg-nav-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--mg-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.mg-nav-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.nav-user-badge {
  display: none !important;
}

/* Row 2: 📍 현재 장소 + 실시간 스탯 알약 */
.mg-locbar {
  flex: none;
  min-height: 40px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--mg-line);
  background: var(--mg-paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mg-loc-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--mg-ink);
  min-width: 0;
  flex: 1;
}
.mg-loc-name span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mg-loc-name svg {
  width: 15px;
  height: 15px;
  color: var(--mg-honey-ink);
  flex-shrink: 0;
}
.mg-stats {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.mg-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f1ed;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--mg-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: background-color 0.25s ease, transform 0.2s ease;
}
.mg-stat i {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--mg-ink-2);
}
.mg-stat.dark {
  background: var(--mg-ink);
  color: #ffffff;
}
.mg-stat.dark i {
  color: #cbd5e1;
}
.mg-stat.pulse-up {
  background: var(--mg-honey);
  color: var(--mg-ink);
  transform: scale(1.06);
}
.mg-stat.pulse-down {
  background: #ffe4e6;
  color: var(--mg-danger);
  transform: scale(1.06);
}

/* Row 3: 장르 · 목표 · 가방 · T 읽기 설정 */
.mg-subbar {
  flex: none;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid var(--mg-line);
  background: var(--mg-paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.mg-sub-genre {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--mg-ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.mg-sub-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.mg-sub-btn {
  height: 26px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--mg-ink);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.mg-sub-btn:hover {
  background: var(--mg-surface);
}
.mg-sub-badge {
  display: inline-grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--mg-honey);
  color: var(--mg-ink);
  font-size: 9.5px;
  font-weight: 800;
}

/* =========================================================
   3. 풀스크린 씬 캔버스 + 상단 4알약(MudSceneHeader) + 스트리밍 로그
   ========================================================= */
.mg-canvas {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #141720;
  overflow: hidden;
}
.mg-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.mg-bg.on {
  opacity: 1;
}
.mg-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 12, 18, 0.54) 0%,
    rgba(10, 12, 18, 0.32) 28%,
    rgba(10, 12, 18, 0.48) 68%,
    rgba(10, 12, 18, 0.68) 100%
  );
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.mg-deadlay {
  position: absolute;
  inset: 0;
  background: rgba(225, 29, 72, 0);
  pointer-events: none;
  transition: background 0.28s ease;
}
.mg-canvas.dead .mg-deadlay {
  background: rgba(225, 29, 72, 0.34);
}
.mg-canvas.shake {
  animation: mgShake 0.32s ease;
}
@keyframes mgShake {
  20% { transform: translateX(4px); }
  45% { transform: translateX(-4px); }
  70% { transform: translateX(3px); }
}

/* 배경만 보기 (eye-off) */
.mg-canvas.eye-off .mg-scrim,
.mg-canvas.eye-off .mg-stream,
.mg-canvas.eye-off .mg-skip-btn {
  opacity: 0;
  pointer-events: none;
}

/* MudSceneHeader — 상단 플로팅 4알약 (둘러보기 · 동석자 · 지도 · 배경) */
.mg-scene-hdr {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  padding: 9px 10px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  background: linear-gradient(180deg, rgba(10, 12, 18, 0.65) 0%, rgba(10, 12, 18, 0.25) 75%, rgba(10, 12, 18, 0) 100%);
  pointer-events: none;
}
.mg-scene-hdr-grp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
}
.mg-scene-pill {
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.88);
  color: var(--mg-ink);
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}
.mg-scene-pill:hover {
  background: #ffffff;
}
.mg-scene-pill.on {
  background: var(--mg-honey);
  border-color: var(--mg-ink);
  color: var(--mg-ink);
}
.mg-scene-pill svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
@media (max-width: 380px) {
  .mg-scene-pill { padding: 0 8px; font-size: 11px; }
}

/* 실시간 스트리밍 로그 (상단 4알약 바와 겹치지 않도록 top: 48px 분리) */
.mg-stream {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  overflow-y: auto;
  padding: 6px 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}
.mg-canvas.lg-font .mg-narr,
.mg-canvas.lg-font .mg-npc-bub,
.mg-canvas.lg-font .mg-me-bub {
  font-size: 16px;
}
.mg-canvas.serif-font .mg-narr,
.mg-canvas.serif-font .mg-npc-bub {
  font-family: var(--mg-serif);
}

@keyframes mgFadeUp {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
.mg-in {
  animation: mgFadeUp 0.2s ease both;
}

/* 실시간 타이핑 커서 */
.mg-caret::after {
  content: "▍";
  display: inline-block;
  margin-left: 2px;
  color: var(--mg-honey);
  animation: mgBlink 0.65s steps(2, start) infinite;
}
@keyframes mgBlink {
  to { visibility: hidden; }
}

/* 서사 텍스트 (장소 스크립트·내레이션) */
.mg-narr {
  margin: 2px 0;
  color: #f8fafc;
  font-size: 14.5px;
  line-height: 1.72;
  font-weight: 500;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.94), 0 0 2px rgba(0, 0, 0, 0.96);
}

/* LookByTypeBubble — 21-game-mobile-393x852.jpg 동일 무테 인라인 존재 행 */
.mg-look-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2px 0 4px;
  padding: 2px 0;
}
.mg-look-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #f8fafc;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.94), 0 0 2px rgba(0, 0, 0, 0.95);
}
.mg-look-av {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  position: relative;
  text-shadow: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.mg-look-av.npc {
  border-radius: 50%;
  background: #dbeafe;
  color: #1e40af;
  border: 1.5px solid #93c5fd;
}
.mg-look-av.player {
  border-radius: 50%;
  background: #ede9fe;
  color: #5b21b6;
  border: 1.5px solid #c4b5fd;
}
.mg-look-av.player::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  border: 1.5px solid #141720;
}
.mg-look-av.self {
  border-radius: 50%;
  background: #dcfce7;
  color: #166534;
  border: 1.5px solid #86efac;
}
.mg-look-av.object {
  width: 18px;
  height: 18px;
  margin: 3px;
  border-radius: 3px;
  transform: rotate(45deg);
  background: #fef3c7;
  border: 1.5px solid var(--mg-honey);
  color: var(--mg-honey-ink);
}
.mg-look-av.object span {
  transform: rotate(-45deg);
  font-size: 9.5px;
  font-weight: 900;
}
.mg-look-btn {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.94);
}
.mg-look-btn.npc { color: var(--mg-npc-link); }
.mg-look-btn.object { color: var(--mg-obj-link); }
.mg-look-btn.object.done { opacity: 0.84; }
.mg-look-btn.object.done::after {
  content: " ✓";
  font-size: 11px;
  font-weight: 900;
  color: #fde68a;
  text-decoration: none;
}
.mg-look-btn.player { color: var(--mg-plr-link); }
.mg-look-self {
  font-weight: 800;
  color: var(--mg-self-link);
}

/* 인라인 살펴보기 상세 카드 */
.mg-inspect-card {
  align-self: flex-start;
  max-width: 92%;
  padding: 10px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--mg-ink);
  border-left: 4px solid var(--mg-honey);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.26);
  font-size: 13px;
  line-height: 1.55;
}
.mg-inspect-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.mg-inspect-head b {
  font-size: 13px;
  color: var(--mg-ink);
}
.mg-inspect-head span {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--mg-surface);
  color: var(--mg-ink-2);
}
.mg-inspect-card p {
  margin: 0;
  color: var(--mg-ink-2);
}
.mg-inspect-talk {
  margin-top: 7px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--mg-ink);
  background: var(--mg-honey);
  color: var(--mg-ink);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

/* NPC 행동 알약 + 대사 말풍선 (21-game-mobile-393x852.jpg 동일 구조) */
.mg-npc-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 91%;
}
.mg-npc-row.cont {
  margin-top: -4px;
}
.mg-npc-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #1e3a8a;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
.mg-npc-av.butler {
  background: #fef3c7;
  border-color: #f59e0b;
  font-size: 14.5px;
}
.mg-npc-av.pet {
  background: #dcfce7;
  border-color: #4ade80;
  font-size: 14px;
}
.mg-npc-row.cont .mg-npc-av {
  visibility: hidden;
  height: 0;
}
.mg-npc-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}
.mg-npc-act {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  background: rgba(224, 231, 255, 0.94);
  color: #1e1b4b;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.38;
}
.mg-npc-bub {
  padding: 10px 14px;
  border-radius: 4px 16px 16px 16px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--mg-ink);
  font-size: 14.5px;
  line-height: 1.62;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
}
.mg-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.72);
  padding: 0 3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* NPC 타이핑 인디케이터 */
.mg-typing-bub {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  border-radius: 4px 16px 16px 16px;
  background: rgba(255, 255, 255, 0.92);
}
.mg-typing-bub i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
  animation: mgBob 1s ease-in-out infinite;
}
.mg-typing-bub i:nth-child(2) { animation-delay: 0.15s; }
.mg-typing-bub i:nth-child(3) { animation-delay: 0.3s; }
@keyframes mgBob {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 1; }
}

/* 플레이어 우측 말풍선 (28-local-quest-completed.jpg 동일 구조) */
.mg-me-row {
  align-self: flex-end;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 7px;
  max-width: 88%;
}
.mg-me-bub {
  padding: 9px 13px;
  border-radius: 16px 4px 16px 16px;
  background: var(--mg-honey-soft);
  border: 1.5px solid var(--mg-honey);
  color: var(--mg-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.54;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.24);
}
.mg-me-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mg-honey);
  color: var(--mg-ink);
  border: 1.5px solid #ffffff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

/* 룰엔진·시스템 헤어라인 로그 (28-local-quest-completed.jpg 동일 구조) */
.mg-sys-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.92);
}
.mg-sys-line::before,
.mg-sys-line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.36);
}
.mg-sys-line.gold {
  color: #fde68a;
}
.mg-sys-line.gold::before,
.mg-sys-line.gold::after {
  background: rgba(251, 191, 36, 0.55);
}
.mg-sys-line.danger {
  color: #fecdd3;
}
.mg-sys-line.danger::before,
.mg-sys-line.danger::after {
  background: rgba(244, 63, 94, 0.55);
}

/* 전투 타격 로그 */
.mg-hit-card {
  align-self: flex-start;
  max-width: 92%;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  border-left: 4px solid var(--mg-ink);
  color: var(--mg-ink);
  font-size: 13px;
  line-height: 1.52;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}
.mg-hit-card.die {
  border-left-color: var(--mg-danger);
  background: #fff1f2;
  color: #9f1239;
}

/* 인라인 전체 폭 선택지 바 (28-local-quest-completed.jpg 동일 구조) */
.mg-choices {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 6px;
}
.mg-choices[hidden] {
  display: none !important;
}
.mg-choice-bar {
  width: 100%;
  padding: 11px 14px;
  border-radius: 22px;
  border: 1.5px solid rgba(17, 17, 17, 0.16);
  background: rgba(255, 255, 255, 0.97);
  color: var(--mg-ink);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.mg-choice-bar:hover {
  background: #fffbeb;
  border-color: var(--mg-honey);
}
.mg-choice-bar:active {
  transform: scale(0.99);
}
.mg-choice-stick {
  width: 3.5px;
  height: 17px;
  border-radius: 99px;
  background: var(--mg-ink);
  flex-shrink: 0;
}
.mg-choice-bar:hover .mg-choice-stick {
  background: var(--mg-honey-ink);
}
.mg-choice-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mg-choice-lbl {
  font-size: 14px;
  font-weight: 700;
  color: var(--mg-ink);
  line-height: 1.38;
}
.mg-choice-sub {
  font-size: 11.5px;
  color: var(--mg-ink-2);
  font-weight: 500;
  line-height: 1.36;
}
.mg-choice-arr {
  font-size: 17px;
  font-weight: 700;
  color: var(--mg-ink-3);
  flex-shrink: 0;
}
.mg-choice-bar.combat .mg-choice-stick {
  background: var(--mg-danger);
}
.mg-choice-bar.ending {
  border-color: rgba(180, 120, 0, 0.45);
  background: rgba(255, 252, 235, 0.98);
}
.mg-choice-bar.ending .mg-choice-stick {
  background: var(--mg-honey-ink);
}
.mg-choice-bar.talk .mg-choice-stick {
  background: #4338ca;
}

/* 공간 이동 출구 바 (현재 방에서 연결된 인접 방 이동) */
.mg-exits-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
  padding-top: 4px;
}
.mg-exits-lbl {
  font-size: 11px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  padding: 0 4px;
}
.mg-exits-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mg-exit-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1.5px solid rgba(17, 17, 17, 0.85);
  background: rgba(255, 255, 255, 0.95);
  color: var(--mg-ink);
  font-size: 12.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.mg-exit-chip:hover {
  background: var(--mg-honey-soft);
  border-color: var(--mg-honey-ink);
}
.mg-exit-chip:active {
  transform: scale(0.98);
}
.mg-exit-chip small {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--mg-ink-3);
}
.mg-exit-chip.locked {
  background: rgba(24, 24, 28, 0.78);
  color: rgba(255, 255, 255, 0.82);
  border: 1px dashed rgba(255, 255, 255, 0.42);
}
.mg-exit-chip.locked small {
  color: rgba(253, 230, 138, 0.9);
}

/* 하단 컴포저 위 대화 대상 · 추천 질문 바 */
.mg-talk-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px 10px 2px;
  border-bottom: 1px solid var(--mg-line);
  background: #fafaf7;
}
.mg-talk-bar[hidden] {
  display: none !important;
}
.mg-talk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mg-talk-target {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--mg-ink);
}
.mg-talk-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mg-honey-ink);
}
.mg-talk-clear {
  border: 0;
  background: var(--mg-surface);
  color: var(--mg-ink-2);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.mg-talk-sugs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.mg-talk-sugs::-webkit-scrollbar {
  display: none;
}
.mg-talk-sug {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--mg-line);
  background: var(--mg-paper);
  color: var(--mg-ink);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.mg-talk-sug:hover {
  border-color: var(--mg-honey-ink);
  background: var(--mg-honey-soft);
}

/* 빨리 감기 플로팅 알약 */
.mg-skip-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 16;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1.5px solid var(--mg-ink);
  background: var(--mg-honey);
  color: var(--mg-ink);
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
}
.mg-skip-btn[hidden] {
  display: none !important;
}

/* 엔딩 · 위기 · 회수 정산 카드 */
.mg-end-card {
  width: 100%;
  margin: 8px 0 4px;
  padding: 18px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--mg-ink);
  border: 1.5px solid var(--mg-ink);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.32);
}
.mg-end-card.bad {
  border-color: var(--mg-danger);
  background: #fffafa;
}
.mg-end-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--mg-honey);
  color: var(--mg-ink);
  font-size: 10.5px;
  font-weight: 800;
  margin-bottom: 7px;
}
.mg-end-card.bad .mg-end-badge {
  background: #ffe4e6;
  color: var(--mg-danger);
}
.mg-end-title {
  margin: 0 0 6px;
  font-size: 16.5px;
  font-weight: 800;
  line-height: 1.32;
}
.mg-end-desc {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--mg-ink-2);
  line-height: 1.58;
}
.mg-receipt {
  border: 1px solid var(--mg-line);
  border-radius: 12px;
  background: var(--mg-surface);
  overflow: hidden;
  margin-bottom: 11px;
}
.mg-receipt-hd {
  padding: 7px 11px;
  background: var(--mg-ink);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
}
.mg-receipt-row {
  padding: 7px 11px;
  border-top: 1px solid var(--mg-line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
}
.mg-receipt-row span { color: var(--mg-ink-2); }
.mg-receipt-row b { color: var(--mg-ink); text-align: right; font-weight: 800; }
.mg-receipt-row.hl { background: var(--mg-honey-soft); }
.mg-end-note {
  margin: 0 0 11px;
  font-size: 11px;
  color: var(--mg-ink-3);
  line-height: 1.48;
}
.mg-end-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.mg-btn {
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1.5px solid var(--mg-ink);
  background: var(--mg-paper);
  color: var(--mg-ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mg-btn:hover { background: var(--mg-surface); }
.mg-btn.honey {
  background: var(--mg-honey);
  box-shadow: 0 2px 0 var(--mg-ink);
}

/* =========================================================
   4. 하단 명령어 · 자유 대화 바 (21-game-mobile-393x852.jpg 동일 구조)
   ========================================================= */
.mg-composer-wrap {
  position: relative;
  flex: none;
  background: var(--mg-paper);
  border-top: 1px solid var(--mg-line);
}
.mg-tray {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(100% + 8px);
  z-index: 25;
  background: var(--mg-paper);
  border: 1.5px solid var(--mg-ink);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  max-height: 240px;
  overflow-y: auto;
}
.mg-tray[hidden] { display: none !important; }
.mg-tray-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 7px;
  border-bottom: 1px solid var(--mg-line);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--mg-ink-2);
}
.mg-tray-hd button {
  border: 0;
  background: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--mg-ink-2);
}
.mg-tray-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 5px;
}
.mg-tray-item {
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  font-size: 12.5px;
}
.mg-tray-item:hover {
  background: var(--mg-surface);
}
.mg-tray-item b { color: var(--mg-ink); font-weight: 700; }
.mg-tray-item small { color: var(--mg-ink-3); font-size: 11px; flex-shrink: 0; }

.mg-composer {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
}
.mg-round-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--mg-line);
  background: var(--mg-surface);
  color: var(--mg-ink);
  font-size: 13.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.mg-round-btn:hover,
.mg-round-btn.on {
  border-color: var(--mg-ink);
  background: var(--mg-honey-soft);
}
.mg-round-btn svg {
  width: 15px;
  height: 15px;
}
.mg-input-pill {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--mg-line);
  background: var(--mg-surface);
  display: flex;
  align-items: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.mg-input-pill:focus-within,
.mg-input-pill.prompt-on {
  border-color: var(--mg-honey-ink);
  background: var(--mg-paper);
  box-shadow: 0 0 0 3px var(--mg-honey-soft);
}
.mg-input-pill input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--mg-ink);
  font-size: 13.5px;
}
.mg-input-pill input::placeholder {
  color: var(--mg-ink-3);
}
.mg-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--mg-ink);
  background: var(--mg-honey);
  color: var(--mg-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.mg-send-btn svg {
  width: 15px;
  height: 15px;
}

/* =========================================================
   5. 모바일 바텀 시트 (480px 컨테이너 하단 슬라이드업 고정)
   ========================================================= */
.mg-modal-dim {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(10, 12, 18, 0.56);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.mg-modal-dim[hidden] { display: none !important; }

@keyframes mgSheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.mg-modal {
  width: 100%;
  max-height: 78%;
  background: var(--mg-paper);
  border-top: 1.5px solid var(--mg-ink);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.35);
  animation: mgSheetUp 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.mg-modal-hd {
  padding: 13px 16px;
  border-bottom: 1px solid var(--mg-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mg-modal-hd b {
  font-size: 14.5px;
  font-weight: 800;
}
.mg-modal-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--mg-surface);
  color: var(--mg-ink);
  font-size: 16px;
  cursor: pointer;
}
.mg-modal-bd {
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* 몽글 정본 2D 공간 지도 (Map.tsx · MudPlay.tsx · mapGeometry.ts 규격) */
.mg-modal-dim.is-map {
  align-items: center;
  padding: 12px;
}
.mg-modal-dim.is-map .mg-modal {
  max-height: 88%;
  border: 1px solid var(--mg-line);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.44);
  animation: mgFadeUp 0.18s ease both;
}
.mg-modal-dim.is-map .mg-modal-bd {
  padding: 0;
  gap: 0;
  overflow: hidden;
}
.mg-map-wrap {
  display: flex;
  flex-direction: column;
  padding: 6px 6px 0;
}
.mg-map-vp {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: min(56vh, 420px);
  background: #e0e0e0;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.mg-map-vp.is-panning {
  cursor: grabbing;
}
.mg-map-tr {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.mg-map-svg {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}
.mg-map-card {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 4px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(89, 97, 109, 0.42);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  overflow: hidden;
  cursor: pointer;
  z-index: 10;
  font-family: inherit;
  transition: background-color 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.mg-map-card.is-open:hover {
  background: #fffbeb;
  border-color: #f59e0b;
}
.mg-map-card.is-cur {
  z-index: 20;
  border: 1.5px solid #f59e0b;
  box-shadow: 0 0 0 2px #e0e0e0, 0 0 0 4px #f59e0b, 0 8px 18px rgba(0, 0, 0, 0.18);
}
.mg-map-card.is-locked {
  opacity: 0.68;
  border: 1px dashed rgba(89, 97, 109, 0.58);
  background: #f8fafc;
}
.mg-map-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 3;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.mg-map-badge.cur {
  background: #fef08a;
  color: #000000;
  border: 1px solid rgba(180, 120, 0, 0.35);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}
.mg-map-badge.lock {
  background: rgba(17, 24, 39, 0.82);
  color: #ffffff;
}
.mg-map-card-img {
  width: 100%;
  height: 50%;
  flex-shrink: 0;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  background: #1f2430;
}
.mg-map-card-lbl {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  line-height: 1.22;
  color: #000000;
  font-weight: 600;
  padding: 0 2px;
  overflow: hidden;
}
.mg-map-card-lbl span {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mg-map-zoom {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 30;
  display: inline-flex;
  gap: 3px;
  background: rgba(255, 255, 255, 0.94);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(89, 97, 109, 0.32);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}
.mg-map-zoom button {
  height: 24px;
  min-width: 24px;
  padding: 0 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #111827;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.mg-map-zoom button:hover {
  background: #fef3c7;
}
.mg-map-foot {
  margin: 6px -6px 0;
  padding: 11px 16px calc(13px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--mg-line);
  background: var(--mg-paper);
}
.mg-map-help {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--mg-ink-2);
  line-height: 1.4;
}
.mg-map-qmark {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.3px solid var(--mg-ink-3);
  color: var(--mg-ink-2);
  font-size: 10px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.mg-map-split {
  margin-top: 8px;
  display: flex;
  align-items: stretch;
  gap: 12px;
}
.mg-map-col {
  flex: 1;
  min-width: 0;
}
.mg-map-col b {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--mg-ink);
}
.mg-map-col small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--mg-ink-2);
}
.mg-map-div {
  width: 1px;
  background: var(--mg-line);
  flex-shrink: 0;
}

/* 목표 · 동석자 · 가방 · 장부 카드 */
.mg-item-card {
  padding: 11px 13px;
  border: 1px solid var(--mg-line);
  border-radius: 12px;
  background: var(--mg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mg-item-card b {
  display: block;
  font-size: 13px;
  color: var(--mg-ink);
}
.mg-item-card span {
  display: block;
  font-size: 11.5px;
  color: var(--mg-ink-2);
  margin-top: 2px;
  line-height: 1.45;
}

/* 토스트 & 사전 알림 바텀 시트 (480px 컨테이너 내부 고정) */
.mg-toast {
  position: absolute;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%);
  z-index: 60;
  width: max-content;
  max-width: calc(100% - 28px);
  padding: 8px 15px;
  border-radius: 16px;
  background: var(--mg-ink);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.42;
  text-align: center;
  white-space: normal;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.mg-toast[hidden] { display: none !important; }

.mg-sheet-dim {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(10, 12, 18, 0.56);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.mg-sheet-dim[hidden] { display: none !important; }
.mg-sheet {
  width: 100%;
  background: var(--mg-paper);
  border-top: 1.5px solid var(--mg-ink);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: mgSheetUp 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.mg-sheet-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.mg-sheet h3 { margin: 0; font-size: 16px; font-weight: 800; line-height: 1.35; }
.mg-sheet p { margin: 0 0 14px; font-size: 13px; color: var(--mg-ink-2); line-height: 1.5; }
.mg-mail-form { display: flex; gap: 7px; }
.mg-mail-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--mg-ink);
  font-size: 13.5px;
  outline: none;
}

/* =========================================================
   6. v14 — 6종 포맷·공간 전용 UI 셸 (스토리·웹툰·웹소설·광장·내 방·아지트)
   ========================================================= */
/* 6A. 로비 포맷 필터 알약 바 & 셸 배지 */
.mg-fmt-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 2px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mg-fmt-tabs::-webkit-scrollbar { display: none; }
.mg-fmt-tab {
  flex-shrink: 0;
  height: 29px;
  padding: 0 8.5px;
  border-radius: 999px;
  border: 1.5px solid var(--mg-line);
  background: var(--mg-paper);
  color: var(--mg-ink-2);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.mg-fmt-tab:hover {
  border-color: var(--mg-ink);
  color: var(--mg-ink);
}
.mg-fmt-tab.active {
  background: var(--mg-ink);
  border-color: var(--mg-ink);
  color: var(--mg-honey);
}

.mg-shell-pill {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: -0.01em;
  background: var(--mg-ink);
  color: #ffffff;
}
.mg-shell-pill[data-shell-badge="webtoon"] { background: #5b21b6; color: #f5f3ff; }
.mg-shell-pill[data-shell-badge="novel"] { background: #fef3c7; color: #78350f; border: 1px solid #f59e0b; }
.mg-shell-pill[data-shell-badge="community"] { background: #fbbf24; color: #111111; }
.mg-shell-pill[data-shell-badge="myroom"] { background: #d1fae5; color: #065f46; border: 1px solid #34d399; }
.mg-shell-pill[data-shell-badge="agit"] { background: #312e81; color: #e0e7ff; }
.mg-shell-pill[data-shell-badge="adult"] { background: #7f1d34; color: #fecdd3; }

.mg-room-subgenre {
  font-size: 11px;
  font-weight: 700;
  color: var(--mg-ink-3);
  line-height: 1.3;
}

/* 6B. 전용 셸 공통 레이아웃 스위치 */
.mg-shell-top[hidden],
.mg-shell-panel[hidden],
.mg-shell-foot[hidden] {
  display: none !important;
}
.mg-shell-top {
  flex: none;
  z-index: 18;
}
.mg-shell-foot {
  flex: none;
}

#mgPlayView[data-shell]:not([data-shell="game"]) .mg-locbar,
#mgPlayView[data-shell]:not([data-shell="game"]) .mg-subbar,
#mgPlayView[data-shell]:not([data-shell="game"]) .mg-scene-hdr {
  display: none !important;
}
#mgPlayView[data-shell]:not([data-shell="game"]) .mg-stream {
  top: 0;
  padding: 12px 14px 24px;
}

#mgPlayView.is-subpanel .mg-stream,
#mgPlayView.is-subpanel .mg-skip-btn {
  visibility: hidden;
  pointer-events: none;
}
#mgPlayView.is-subpanel .mg-composer-wrap {
  display: none !important;
}
.mg-shell-panel {
  position: absolute;
  inset: 0;
  z-index: 22;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #f6f6f3;
  padding: 12px 12px 24px;
}

/* 상단 셸 바 공통 */
.mg-sh-bar {
  min-height: 40px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-bottom: 1px solid var(--mg-line);
  background: var(--mg-paper);
}
.mg-sh-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.mg-sh-right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.mg-sh-room {
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.mg-sh-chip {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}
.mg-sh-btn {
  height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--mg-line);
  background: var(--mg-surface);
  color: var(--mg-ink);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

/* 상단 세컨더리 탭 바 (광장 · 내 방 · 아지트) */
.mg-sh-tabs {
  display: flex;
  align-items: stretch;
  background: var(--mg-paper);
  border-bottom: 1px solid var(--mg-line);
  padding: 0 6px;
  gap: 2px;
}
.mg-sh-tab {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 4px;
  border: 0;
  border-bottom: 2.5px solid transparent;
  background: transparent;
  color: var(--mg-ink-3);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}
.mg-sh-tab.active {
  color: var(--mg-ink);
  border-bottom-color: var(--mg-ink);
}
.mg-sh-tab em {
  font-style: normal;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--mg-surface);
  font-size: 10px;
  font-weight: 800;
}
.mg-sh-tab em.turn {
  background: var(--mg-honey);
  color: var(--mg-ink);
}
.mg-tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e11d48;
  display: inline-block;
}

/* 6C. SHELL 2 — 인터랙티브 웹툰 무한 종스크롤 뷰어 (webtoon) */
#mgPlayView[data-shell="webtoon"] .mg-nav {
  background: #10131d;
  border-bottom-color: #23293d;
  color: #f8fafc;
}
#mgPlayView[data-shell="webtoon"] .mg-nav-title,
#mgPlayView[data-shell="webtoon"] .mg-nav-back,
#mgPlayView[data-shell="webtoon"] .mg-ic-btn {
  color: #f8fafc;
}
#mgPlayView[data-shell="webtoon"] .mg-canvas {
  background: #0c0e16;
}
#mgPlayView[data-shell="webtoon"] .mg-bg,
#mgPlayView[data-shell="webtoon"] .mg-scrim {
  display: none !important;
}
#mgPlayView[data-shell="webtoon"] .mg-stream {
  padding: 10px 10px 32px;
  gap: 14px;
}
.mg-wt-progress {
  height: 3px;
  width: 100%;
  background: #23293d;
}
.mg-wt-progress i {
  display: block;
  height: 100%;
  background: var(--mg-honey);
  transition: width 0.2s ease;
}
.mg-sh-bar.wt {
  background: #151927;
  border-bottom-color: #262d44;
  color: #f8fafc;
}
.mg-wt-ep,
.mg-wt-ep-tag {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--mg-honey);
  color: #111111;
  font-size: 10.5px;
  font-weight: 900;
  flex-shrink: 0;
}
.mg-sh-bar.wt .mg-sh-room { color: #f8fafc; }
.mg-sh-chip.wt { background: rgba(167, 139, 250, 0.22); color: #ddd6fe; }
.mg-sh-btn.wt { background: #23293d; border-color: #36405e; color: #f8fafc; }

#mgPlayView[data-shell="webtoon"] .mg-look-group {
  background: transparent;
  border: 0;
  padding: 0;
}
.mg-wt-strip {
  background: #ffffff;
  padding: 10px 10px 14px;
  border-radius: 12px;
  border: 2px solid #111111;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.48);
}
.mg-wt-cut-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 2px 6px;
  border-bottom: 1.5px solid #e2e8f0;
  color: #0f172a;
  font-size: 13px;
}
.mg-wt-cut-hd b {
  font-weight: 800;
  color: #0f172a;
}
.mg-wt-panel {
  position: relative;
  width: 100%;
  height: 224px;
  border: 2.5px solid #111111;
  overflow: hidden;
  background: #181b24;
}
.mg-wt-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mg-wt-cutno {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 7px;
  background: #111111;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.mg-wt-sfx {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 9px;
  background: var(--mg-honey);
  color: #111111;
  border: 2px solid #111111;
  box-shadow: 2px 2px 0 #111111;
  font-size: 12px;
  font-weight: 900;
  transform: rotate(-4deg);
}
.mg-wt-sfx.alt {
  top: 9px;
  right: 10px;
  left: auto;
  background: #ede9fe;
  color: #3b0764;
  transform: rotate(3deg);
}
.mg-wt-cap {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 36px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.95);
  border: 1.8px solid #111111;
  color: #111111;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.44;
  text-shadow: none;
}
.mg-wt-panel:not(:has(.mg-wt-speech)) .mg-wt-cap {
  top: auto;
  bottom: 8px;
}
.mg-wt-speech {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 9px;
  padding: 7px 12px;
  border-radius: 18px;
  background: #ffffff;
  border: 2px solid #111111;
  box-shadow: 2px 3px 0 #111111;
  color: #111111;
  font-size: 12.5px;
  line-height: 1.44;
  text-shadow: none;
}
.mg-wt-speech b {
  display: inline-block;
  margin-right: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #111111;
  color: var(--mg-honey);
  font-size: 10.5px;
  font-weight: 800;
}

.mg-wt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  background: #151927;
  border-bottom: 1px solid #262d44;
  color: #f8fafc;
}
.mg-wt-step {
  height: 27px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid #3b4464;
  background: #23293d;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.mg-wt-step.accent {
  background: var(--mg-honey);
  border-color: var(--mg-honey);
  color: #111111;
}
.mg-wt-prog {
  font-size: 11px;
  font-weight: 800;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 웹툰 · 웹소설 공통 리더 알약 칩 (MUD 문장 대체) */
.mg-reader-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 2px 2px;
}
.mg-look-btn.reader-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(30, 36, 56, 0.9);
  color: #f1f5f9;
  text-shadow: none;
  cursor: pointer;
}
.mg-look-btn.reader-pill.object {
  border-color: rgba(250, 204, 21, 0.45);
  color: #fde68a;
}
.mg-look-btn.reader-pill.done {
  opacity: 0.62;
}
.mg-exits-bar.reader-jumps {
  background: transparent;
  border: 0;
  padding: 4px 0 0;
}
.mg-exit-chip.reader-chip {
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11.5px;
}

/* 무한 종스크롤 구분선 & 후속 연재 회차 컨테이너 */
.mg-vscroll-div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 4px;
  font-size: 11px;
  color: #64748b;
}
.mg-vscroll-div::before,
.mg-vscroll-div::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.25);
}
.mg-infinite-tail {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 14px;
  padding-bottom: 28px;
}
.mg-inf-ep {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mg-inf-ep-hd.wt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #171c2d;
  border: 1px solid #2e3856;
  color: #f8fafc;
}
.mg-inf-ep-titles {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.mg-inf-ep-titles b {
  font-size: 13.5px;
  font-weight: 800;
  color: #f8fafc;
}
.mg-inf-ep-titles small {
  font-size: 11px;
  color: #94a3b8;
}
.mg-inf-ep-cue {
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 10px;
}
.mg-inf-ep-cue.wt {
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}
.mg-inf-ep-cue.fin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
}
.mg-inf-fin-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.mg-inf-fin-btn {
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: transparent;
  color: inherit;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.mg-inf-ep-cue.wt .mg-inf-fin-btn.pri {
  background: var(--mg-honey);
  border-color: var(--mg-honey);
  color: #111111;
}
.mg-inf-ep-cue.nv .mg-inf-fin-btn.pri {
  background: #b45309;
  border-color: #b45309;
  color: #ffffff;
}

/* 6D. SHELL 3 — 인터랙티브 웹소설 무한 종스크롤 리더 (novel) */
#mgPlayView[data-shell="novel"] {
  --nv-bg: #faf5eb;
  --nv-card: #f3ecdd;
  --nv-ink: #231d16;
  --nv-muted: #786b59;
  --nv-line: #e4dac5;
}
#mgPlayView[data-shell="novel"][data-paper="white"] {
  --nv-bg: #ffffff;
  --nv-card: #f7f7f5;
  --nv-ink: #18181b;
  --nv-muted: #71717a;
  --nv-line: #e4e4e7;
}
#mgPlayView[data-shell="novel"][data-paper="night"] {
  --nv-bg: #18181d;
  --nv-card: #22222a;
  --nv-ink: #e7e5e4;
  --nv-muted: #a1a1aa;
  --nv-line: #32323e;
}
#mgPlayView[data-shell="novel"] .mg-nav {
  background: var(--nv-bg);
  border-bottom-color: var(--nv-line);
}
#mgPlayView[data-shell="novel"] .mg-nav-title {
  font-family: var(--mg-serif);
  color: var(--nv-ink);
}
#mgPlayView[data-shell="novel"] .mg-nav-back,
#mgPlayView[data-shell="novel"] .mg-ic-btn {
  color: var(--nv-ink);
}
#mgPlayView[data-shell="novel"] .mg-canvas {
  background: var(--nv-bg);
}
#mgPlayView[data-shell="novel"] .mg-bg,
#mgPlayView[data-shell="novel"] .mg-scrim {
  display: none !important;
}
.mg-nv-progress {
  height: 3px;
  width: 100%;
  background: var(--nv-line);
}
.mg-nv-progress i {
  display: block;
  height: 100%;
  background: #b45309;
  transition: width 0.2s ease;
}
.mg-sh-bar.nv {
  background: var(--nv-bg);
  border-bottom-color: var(--nv-line);
  color: var(--nv-ink);
}
.mg-nv-chap {
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--nv-card);
  border: 1px solid var(--nv-line);
  color: var(--nv-muted);
  font-family: var(--mg-serif);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.mg-sh-bar.nv .mg-sh-room {
  font-family: var(--mg-serif);
  color: var(--nv-ink);
}
.mg-nv-papers {
  display: inline-flex;
  gap: 3px;
}
.mg-nv-dot {
  height: 23px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--nv-line);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.mg-nv-dot.cream { background: #faf5eb; color: #3f3222; }
.mg-nv-dot.white { background: #ffffff; color: #18181b; }
.mg-nv-dot.night { background: #1f1f26; color: #f4f4f5; }
.mg-nv-dot.on { outline: 2px solid #b45309; outline-offset: -1px; }
.mg-sh-btn.nv {
  background: var(--nv-card);
  border-color: var(--nv-line);
  color: var(--nv-ink);
}
.mg-sh-btn.nv.on {
  background: #b45309;
  border-color: #b45309;
  color: #ffffff;
}

#mgPlayView[data-shell="novel"] .mg-stream {
  padding: 18px 20px 36px;
  gap: 14px;
}
.mg-nv-sec {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mg-nv-sec.inf-ep {
  padding-top: 14px;
  border-top: 1px solid var(--nv-line);
}
.mg-nv-sec-hd {
  text-align: center;
  padding: 8px 4px 12px;
  border-bottom: 1px solid var(--nv-line);
}
.mg-nv-sec-no {
  display: inline-block;
  font-family: var(--mg-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #b45309;
  margin-bottom: 4px;
}
.mg-nv-sec-tit {
  margin: 0;
  font-family: var(--mg-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--nv-ink);
}
.mg-nv-sec-sub {
  margin: 4px 0 0;
  font-family: var(--mg-serif);
  font-size: 12px;
  color: var(--nv-muted);
}
.mg-nv-prose {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mg-nv-prose p,
#mgPlayView[data-shell="novel"] .mg-narr {
  margin: 0;
  font-family: var(--mg-serif);
  color: var(--nv-ink);
  text-shadow: none;
  font-size: 15.5px;
  line-height: 1.98;
  text-indent: 0.8em;
  word-break: keep-all;
}
#mgPlayView[data-shell="novel"] .mg-canvas.lg-font .mg-nv-prose p,
#mgPlayView[data-shell="novel"] .mg-canvas.lg-font .mg-narr,
#mgPlayView[data-shell="novel"] .mg-canvas.lg-font .mg-npc-bub {
  font-size: 17.5px;
}
#mgPlayView[data-shell="novel"] .mg-sys-line {
  font-family: var(--mg-serif);
  color: var(--nv-muted);
  text-shadow: none;
}
#mgPlayView[data-shell="novel"] .mg-sys-line::before,
#mgPlayView[data-shell="novel"] .mg-sys-line::after {
  background: var(--nv-line);
}
#mgPlayView[data-shell="novel"] .mg-look-group {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}
#mgPlayView[data-shell="novel"] .mg-look-btn.reader-pill {
  background: var(--nv-card);
  border-color: var(--nv-line);
  color: var(--nv-ink);
  font-family: var(--mg-serif);
}
#mgPlayView[data-shell="novel"] .mg-look-btn.reader-pill.npc {
  color: #1d4ed8;
}
#mgPlayView[data-shell="novel"] .mg-look-btn.reader-pill.object {
  color: #b45309;
  border-color: #d6c8ad;
}
#mgPlayView[data-shell="novel"][data-paper="night"] .mg-look-btn.reader-pill.npc { color: #93c5fd; }
#mgPlayView[data-shell="novel"][data-paper="night"] .mg-look-btn.reader-pill.object { color: #fcd34d; border-color: #52525b; }
#mgPlayView[data-shell="novel"] .mg-npc-bub {
  font-family: var(--mg-serif);
  background: var(--nv-card);
  color: var(--nv-ink);
  border-left: 3px solid #b45309;
  border-radius: 3px 12px 12px 3px;
  box-shadow: none;
  line-height: 1.82;
}
#mgPlayView[data-shell="novel"] .mg-npc-act,
#mgPlayView[data-shell="novel"] .mg-time {
  color: var(--nv-muted);
  text-shadow: none;
}
#mgPlayView[data-shell="novel"] .mg-choice-bar {
  background: var(--nv-card);
  border-color: var(--nv-line);
  color: var(--nv-ink);
}
#mgPlayView[data-shell="novel"] .mg-choice-lbl {
  font-family: var(--mg-serif);
  color: var(--nv-ink);
  text-shadow: none;
}
#mgPlayView[data-shell="novel"] .mg-choice-sub {
  color: var(--nv-muted);
}
#mgPlayView[data-shell="novel"] .mg-exit-chip.reader-chip {
  background: var(--nv-card);
  border-color: var(--nv-line);
  color: var(--nv-muted);
  font-family: var(--mg-serif);
}
.mg-vscroll-div.novel {
  color: #b45309;
}
.mg-vscroll-div.novel::before,
.mg-vscroll-div.novel::after {
  background: var(--nv-line);
}
.mg-inf-ep-cue.nv {
  background: var(--nv-card);
  border: 1px dashed var(--nv-line);
  color: var(--nv-muted);
  font-family: var(--mg-serif);
}

.mg-nv-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 6px 8px;
  background: var(--nv-card, #f3ecdd);
  border-bottom: 1px solid var(--nv-line, #e4dac5);
}
.mg-nv-step,
.mg-nv-talk {
  height: 27px;
  padding: 0 7.5px;
  border-radius: 999px;
  border: 1px solid #d6c8ad;
  background: #ffffff;
  color: #231d16;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.mg-nv-step.accent {
  background: #b45309;
  border-color: #b45309;
  color: #ffffff;
}
.mg-nv-talk {
  background: #fef3c7;
  border-color: #d97706;
  color: #78350f;
}
.mg-nv-meta {
  font-family: var(--mg-serif);
  font-size: 11px;
  font-weight: 700;
  color: var(--nv-muted, #786b59);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 6E. 라이트 캔버스 공용 규칙 (광장 커뮤니티 · 내 방 · 친구 아지트) */
#mgPlayView[data-shell="community"] .mg-canvas { background: #eef1f8; }
#mgPlayView[data-shell="agit"] .mg-canvas { background: #f4f3fb; }
#mgPlayView[data-shell="myroom"] .mg-canvas { background: #fbf7f0; }
#mgPlayView[data-shell="myroom"][data-mood="amber"] .mg-canvas { background: #f9f0e1; }
#mgPlayView[data-shell="myroom"][data-mood="rain"] .mg-canvas { background: #edf2f7; }

#mgPlayView[data-shell="community"] .mg-bg.on,
#mgPlayView[data-shell="myroom"] .mg-bg.on,
#mgPlayView[data-shell="agit"] .mg-bg.on {
  opacity: 0.34 !important;
}
#mgPlayView[data-shell="community"] .mg-canvas.eye-off .mg-bg.on,
#mgPlayView[data-shell="myroom"] .mg-canvas.eye-off .mg-bg.on,
#mgPlayView[data-shell="agit"] .mg-canvas.eye-off .mg-bg.on {
  opacity: 1 !important;
}
#mgPlayView[data-shell="community"] .mg-scrim {
  background: linear-gradient(180deg, rgba(238, 241, 248, 0.72), rgba(238, 241, 248, 0.88));
}
#mgPlayView[data-shell="agit"] .mg-scrim {
  background: linear-gradient(180deg, rgba(244, 243, 251, 0.72), rgba(244, 243, 251, 0.88));
}
#mgPlayView[data-shell="myroom"] .mg-scrim {
  background: linear-gradient(180deg, rgba(251, 247, 240, 0.72), rgba(251, 247, 240, 0.88));
}
#mgPlayView[data-shell="myroom"][data-mood="amber"] .mg-scrim {
  background: linear-gradient(180deg, rgba(254, 243, 199, 0.70), rgba(249, 240, 225, 0.88));
}
#mgPlayView[data-shell="myroom"][data-mood="rain"] .mg-scrim {
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.74), rgba(237, 242, 247, 0.89));
}

#mgPlayView[data-shell="community"] .mg-narr,
#mgPlayView[data-shell="myroom"] .mg-narr,
#mgPlayView[data-shell="agit"] .mg-narr {
  color: #1e293b;
  text-shadow: none;
}
#mgPlayView[data-shell="community"] .mg-sys-line,
#mgPlayView[data-shell="myroom"] .mg-sys-line,
#mgPlayView[data-shell="agit"] .mg-sys-line {
  color: #475569;
  text-shadow: none;
}
#mgPlayView[data-shell="community"] .mg-sys-line::before,
#mgPlayView[data-shell="community"] .mg-sys-line::after,
#mgPlayView[data-shell="myroom"] .mg-sys-line::before,
#mgPlayView[data-shell="myroom"] .mg-sys-line::after,
#mgPlayView[data-shell="agit"] .mg-sys-line::before,
#mgPlayView[data-shell="agit"] .mg-sys-line::after {
  background: rgba(71, 85, 105, 0.24);
}
#mgPlayView[data-shell="community"] .mg-sys-line.gold,
#mgPlayView[data-shell="myroom"] .mg-sys-line.gold,
#mgPlayView[data-shell="agit"] .mg-sys-line.gold {
  color: #92400e;
}
#mgPlayView[data-shell="community"] .mg-look-group,
#mgPlayView[data-shell="myroom"] .mg-look-group,
#mgPlayView[data-shell="agit"] .mg-look-group {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}
#mgPlayView[data-shell="community"] .mg-look-row,
#mgPlayView[data-shell="myroom"] .mg-look-row,
#mgPlayView[data-shell="agit"] .mg-look-row {
  color: #1e293b;
  text-shadow: none;
}
#mgPlayView[data-shell="community"] .mg-look-btn,
#mgPlayView[data-shell="myroom"] .mg-look-btn,
#mgPlayView[data-shell="agit"] .mg-look-btn {
  text-shadow: none;
}
#mgPlayView[data-shell="community"] .mg-look-btn.npc,
#mgPlayView[data-shell="myroom"] .mg-look-btn.npc,
#mgPlayView[data-shell="agit"] .mg-look-btn.npc { color: #1d4ed8; }
#mgPlayView[data-shell="community"] .mg-look-btn.object,
#mgPlayView[data-shell="myroom"] .mg-look-btn.object,
#mgPlayView[data-shell="agit"] .mg-look-btn.object { color: #b45309; }
#mgPlayView[data-shell="community"] .mg-look-btn.object.done::after,
#mgPlayView[data-shell="myroom"] .mg-look-btn.object.done::after,
#mgPlayView[data-shell="agit"] .mg-look-btn.object.done::after { color: #059669; }
#mgPlayView[data-shell="community"] .mg-look-btn.player,
#mgPlayView[data-shell="myroom"] .mg-look-btn.player,
#mgPlayView[data-shell="agit"] .mg-look-btn.player { color: #6d28d9; }
#mgPlayView[data-shell="community"] .mg-look-self,
#mgPlayView[data-shell="myroom"] .mg-look-self,
#mgPlayView[data-shell="agit"] .mg-look-self { color: #047857; }
#mgPlayView[data-shell="community"] .mg-time,
#mgPlayView[data-shell="myroom"] .mg-time,
#mgPlayView[data-shell="agit"] .mg-time {
  color: #64748b;
  text-shadow: none;
}
#mgPlayView[data-shell="community"] .mg-exits-lbl,
#mgPlayView[data-shell="myroom"] .mg-exits-lbl,
#mgPlayView[data-shell="agit"] .mg-exits-lbl {
  color: #475569;
  text-shadow: none;
}

/* 6F. SHELL 4 (광장) · SHELL 5 (내 방) · SHELL 6 (아지트) 헤더 디테일 */
.mg-sh-bar.cm { background: #fffbeb; border-bottom-color: #fde68a; }
.mg-cm-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.mg-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  display: inline-block;
}
.mg-cm-chan {
  font-size: 12.5px;
  font-weight: 900;
  color: #111111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mg-sh-chip.cm { background: var(--mg-honey); color: #111111; }

.mg-sh-bar.mr { background: #fdfbf7; border-bottom-color: #ece5d8; }
.mg-mr-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: #d1fae5;
  color: #065f46;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.mg-sh-chip.mr { background: #fef3c7; color: #78350f; }
.mg-sh-chip.mr-soft { background: #f1f5f9; color: #334155; }

.mg-sh-bar.ag {
  background: #1e1b4b;
  border-bottom-color: #312e81;
  color: #ffffff;
}
.mg-ag-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: #4338ca;
  color: #eef2ff;
  font-size: 10.5px;
  font-weight: 800;
  flex-shrink: 0;
}
.mg-ag-crew {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.mg-ag-crew::-webkit-scrollbar { display: none; }
.mg-ag-member {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.mg-ag-member i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
}
.mg-ag-member.on {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}
.mg-ag-member.on i {
  background: #4ade80;
}
.mg-sh-btn.ag-inv {
  background: var(--mg-honey);
  border-color: var(--mg-honey);
  color: #111111;
}
.mg-sh-btn.ag {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
.mg-ag-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: #eef2ff;
  border-bottom: 1px solid #c7d2fe;
  font-size: 11px;
  font-weight: 800;
  color: #312e81;
}
.mg-ag-track {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: #c7d2fe;
  overflow: hidden;
}
.mg-ag-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #4f46e5;
  transition: width 0.3s ease;
}

/* 인라인 룸 배너 (광장 공지 · 내 방 무드 · 아지트 릴레이) */
.mg-shell-inline {
  margin-bottom: 6px;
}
.mg-inline-banner {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mg-inline-banner.cm { background: #fffbeb; border-color: #fde68a; }
.mg-inline-banner.mr { background: #f0fdf4; border-color: #bbf7d0; }
.mg-inline-banner.ag { background: #eef2ff; border-color: #c7d2fe; }
.mg-ib-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.35;
}
.mg-ib-pin {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 6px;
  background: #111111;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
}
.mg-ib-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.mg-ib-pill {
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #ffffff;
  color: #1e293b;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.mg-ib-pill.on {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}
.mg-ib-pill.accent {
  background: var(--mg-honey);
  border-color: #111111;
  color: #111111;
}

/* 6G. 서브패널 (게시판 · 공간 · 꾸미기 · 진열장 · 방명록 · 릴레이 보드 · 공동 컬렉션) */
.mg-sp-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mg-sp-sec-tit {
  font-size: 12px;
  font-weight: 900;
  color: var(--mg-ink-2);
  padding: 2px 4px 0;
}
.mg-sp-card {
  background: #ffffff;
  border: 1px solid var(--mg-line);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.mg-sp-card.gift {
  background: #fffbeb;
  border-color: #f59e0b;
}
.mg-sp-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mg-sp-hd b { font-size: 13.5px; font-weight: 800; color: var(--mg-ink); }
.mg-sp-hd span {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--mg-surface);
  color: var(--mg-ink-2);
}
.mg-sp-sub {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--mg-ink-2);
}
.mg-sp-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mg-sp-form input {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--mg-line);
  background: var(--mg-surface);
  font-size: 12.5px;
  color: var(--mg-ink);
  outline: none;
}
.mg-sp-form input:focus {
  border-color: var(--mg-ink);
  background: #ffffff;
}
.mg-sp-form-row {
  display: flex;
  gap: 6px;
}
.mg-sp-form-row input { flex: 1; min-width: 0; }
.mg-sp-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.mg-board-item {
  background: #ffffff;
  border: 1px solid var(--mg-line);
  border-radius: 12px;
  overflow: hidden;
}
.mg-board-hd {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  text-align: left;
  cursor: pointer;
}
.mg-board-tag {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--mg-honey-soft);
  color: var(--mg-honey-ink);
  font-size: 10.5px;
  font-weight: 800;
  flex-shrink: 0;
}
.mg-board-tit {
  flex: 1;
  min-width: 140px;
  font-size: 13px;
  font-weight: 800;
  color: var(--mg-ink);
}
.mg-board-hd small {
  font-size: 11px;
  color: var(--mg-ink-3);
  margin-left: auto;
}
.mg-board-body {
  margin: 0;
  padding: 0 12px 11px;
  font-size: 12.5px;
  line-height: 1.54;
  color: var(--mg-ink-2);
}

.mg-sp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 380px) {
  .mg-sp-grid { grid-template-columns: 1fr; }
}
.mg-space-card {
  background: #ffffff;
  border: 1px solid var(--mg-line);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mg-space-card.cur {
  border: 1.5px solid var(--mg-ink);
  background: #fffdf5;
}
.mg-space-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.mg-space-top b { font-size: 12.5px; color: var(--mg-ink); }
.mg-space-cnt {
  font-size: 10.5px;
  font-weight: 800;
  color: #166534;
  background: #dcfce7;
  padding: 1px 6px;
  border-radius: 999px;
}
.mg-space-card p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.44;
  color: var(--mg-ink-2);
  flex: 1;
}
.mg-portal-row,
.mg-prop-row {
  background: #ffffff;
  border: 1px solid var(--mg-line);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mg-portal-row b,
.mg-prop-row b {
  font-size: 12.5px;
  color: var(--mg-ink);
}
.mg-portal-row small,
.mg-prop-row small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--mg-ink-3);
}
.mg-mood-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mg-mood-btn {
  flex: 1;
  min-width: 96px;
  height: 32px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--mg-line);
  background: var(--mg-surface);
  color: var(--mg-ink);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.mg-mood-btn.active {
  background: var(--mg-ink);
  border-color: var(--mg-ink);
  color: var(--mg-honey);
}

.mg-relay-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 11px;
  border: 1px solid var(--mg-line);
  background: var(--mg-surface);
}
.mg-relay-row.done {
  background: #f0fdf4;
  border-color: #86efac;
}
.mg-relay-row.turn {
  background: #fffbeb;
  border-color: #f59e0b;
}
.mg-relay-step {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--mg-ink);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  flex-shrink: 0;
}
.mg-relay-body { flex: 1; min-width: 0; }
.mg-relay-body b { display: block; font-size: 12.5px; color: var(--mg-ink); }
.mg-relay-body small { display: block; margin-top: 2px; font-size: 11px; color: var(--mg-ink-2); }
.mg-relay-st {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #16a34a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.mg-relay-row.turn .mg-relay-st {
  background: var(--mg-honey);
  color: #111111;
}
.mg-sp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}
.mg-sp-actions .mg-btn {
  width: 100%;
}

/* 6H. 내 방 · 광장 · 아지트 비주얼 스테이지 & 아이템 시각화 배치 & AI 집사/펫 */
.mg-stat-ico {
  font-style: normal;
  margin-right: 2px;
  font-size: 11px;
}
.mg-look-av.butler {
  background: linear-gradient(135deg, #fef3c7, #f59e0b);
  color: #111111;
  font-size: 12px;
}
.mg-look-av.pet {
  background: linear-gradient(135deg, #dcfce7, #4ade80);
  color: #111111;
  font-size: 12px;
}

.mg-visual-stage {
  position: relative;
  width: 100%;
  height: 206px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #1e293b;
  margin-bottom: 7px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  user-select: none;
}
.mg-visual-stage.myroom {
  height: 222px;
}
.mg-visual-stage.preview {
  margin-bottom: 2px;
}
.mg-stage-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 52%;
  display: block;
  transition: filter 0.35s ease, transform 0.35s ease;
}
.mg-visual-stage[data-room-mood="amber"] .mg-stage-img {
  filter: sepia(0.22) saturate(1.18) brightness(0.92);
}
.mg-visual-stage[data-room-mood="rain"] .mg-stage-img {
  filter: hue-rotate(195deg) saturate(0.78) brightness(0.88);
}
.mg-stage-light {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.36) 0%, rgba(15, 23, 42, 0.04) 38%, rgba(15, 23, 42, 0.56) 100%);
}
.mg-stage-light.amber {
  background:
    radial-gradient(circle at 75% 42%, rgba(251, 191, 36, 0.28), transparent 55%),
    linear-gradient(180deg, rgba(30, 27, 75, 0.38) 0%, rgba(120, 53, 15, 0.12) 45%, rgba(15, 23, 42, 0.62) 100%);
}
.mg-stage-light.rain {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.46) 0%, rgba(30, 58, 138, 0.18) 48%, rgba(15, 23, 42, 0.64) 100%);
}

.mg-stage-head {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  z-index: 3;
  pointer-events: none;
}
.mg-stage-loc,
.mg-stage-mood {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  max-width: 58%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mg-stage-mood {
  background: rgba(255, 251, 235, 0.9);
  color: #78350f;
  max-width: 46%;
}
.mg-stage-mood.live {
  background: rgba(220, 252, 231, 0.94);
  color: #166534;
}

.mg-stage-props {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
@keyframes mgPropPop {
  0% { transform: scale(0.78); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.mg-stage-prop {
  position: absolute;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: mgPropPop 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.mg-stage-prop svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.42));
  transition: transform 0.18s ease;
}
.mg-stage-prop.placed:hover svg,
.mg-stage-prop.placed:active svg {
  transform: translateY(-2px) scale(1.05);
}
.mg-prop-chip {
  margin-top: -2px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fef3c7;
  font-size: 9.5px;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1.35;
}
.mg-stage-prop.ghost {
  width: auto !important;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.85);
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.mg-stage-prop.ghost:hover {
  background: rgba(245, 158, 11, 0.92);
  color: #111111;
  border-style: solid;
}
.mg-lamp-aura {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253, 224, 71, 0.45) 0%, rgba(251, 191, 36, 0) 70%);
  pointer-events: none;
}

.mg-stage-prop.pos-frame { left: 14%; top: 18%; width: 48px; }
.mg-stage-prop.pos-trophy { left: 45%; top: 19%; width: 46px; }
.mg-stage-prop.pos-kettle { left: 9%; bottom: 23%; width: 56px; }
.mg-stage-prop.pos-rug { left: 32%; bottom: 19%; width: 122px; }
.mg-stage-prop.pos-lamp { right: 9%; bottom: 22%; width: 54px; }
.mg-stage-prop.pos-shelf-center { left: 39%; top: 30%; width: 64px; }

.mg-stage-actors {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 3;
}
.mg-stage-actors::-webkit-scrollbar { display: none; }
.mg-stage-actor {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(6px);
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  text-align: left;
}
.mg-stage-actor.butler { border-color: rgba(253, 224, 71, 0.72); }
.mg-stage-actor.pet { border-color: rgba(134, 239, 172, 0.78); }
.mg-sa-av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  font-size: 12px;
  flex-shrink: 0;
}
.mg-stage-actor.butler .mg-sa-av { background: #fef08a; color: #78350f; }
.mg-stage-actor.pet .mg-sa-av { background: #bbf7d0; color: #14532d; }
.mg-sa-txt {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1.2;
}
.mg-sa-txt b {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
}
.mg-sa-txt small {
  font-size: 10px;
  font-weight: 700;
  color: #fde68a;
}
.mg-stage-actor.pet .mg-sa-txt small { color: #bbf7d0; }

.mg-companion-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 7px;
}
.mg-comp-btn {
  height: 30px;
  padding: 0 8px;
  border-radius: 9px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #ffffff;
  color: #1e293b;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mg-comp-btn.butler {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #78350f;
}
.mg-comp-btn.pet {
  background: #f0fdf4;
  border-color: #86efac;
  color: #14532d;
}
.mg-comp-btn:active {
  transform: scale(0.98);
}

/* 서브패널 공간 썸네일 · 미니 소품 프리뷰 · 폴라로이드 사진 */
.mg-space-thumb {
  position: relative;
  width: 100%;
  height: 76px;
  border-radius: 8px;
  overflow: hidden;
  background: #e2e8f0;
}
.mg-space-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mg-space-thumb .mg-space-cnt {
  position: absolute;
  right: 6px;
  bottom: 6px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}
.mg-portal-thumb {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--mg-line);
}
.mg-portal-meta,
.mg-prop-meta {
  flex: 1;
  min-width: 0;
}
.mg-prop-mini-svg {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 3px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.mg-prop-mini-svg svg {
  width: 100%;
  height: 100%;
}
.mg-polaroid-photo {
  padding: 8px 8px 0;
}
.mg-polaroid-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

/* 6I. 스탯 변화 시각화 게이지 카드 (.mg-stat-strip) */
.mg-stat-row {
  margin: 4px 0;
}
.mg-stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 6px;
}
.mg-stat-card {
  padding: 7px 10px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(250, 204, 21, 0.36);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mg-stat-card.down {
  border-color: rgba(248, 113, 113, 0.45);
}
.mg-st-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.mg-st-lbl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 800;
  color: #f8fafc;
}
.mg-st-lbl em {
  font-style: normal;
  font-size: 12px;
}
.mg-st-delta {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.22);
  color: #fde047;
  font-size: 10.5px;
  font-weight: 900;
}
.mg-st-delta.down {
  background: rgba(248, 113, 113, 0.22);
  color: #fca5a5;
}
.mg-st-meter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mg-st-pips {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mg-st-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.34);
  display: inline-block;
}
.mg-st-pip.on {
  background: #facc15;
  border-color: #fef08a;
  box-shadow: 0 0 6px rgba(250, 204, 21, 0.65);
}
.mg-st-pip.new {
  transform: scale(1.18);
}
.mg-st-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.mg-st-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #fde047);
  transition: width 0.35s ease;
}
.mg-stat-card.down .mg-st-track i {
  background: linear-gradient(90deg, #ef4444, #fca5a5);
}
.mg-st-val {
  font-size: 11.5px;
  font-weight: 900;
  color: #fef9c3;
  flex-shrink: 0;
}

/* 라이트 셸 & 웹소설 종이 테마용 스탯 카드 색채 보정 */
#mgPlayView[data-shell="community"] .mg-stat-card,
#mgPlayView[data-shell="myroom"] .mg-stat-card,
#mgPlayView[data-shell="agit"] .mg-stat-card,
#mgPlayView[data-shell="novel"]:not([data-paper="night"]) .mg-stat-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: #f59e0b;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
#mgPlayView[data-shell="community"] .mg-st-lbl,
#mgPlayView[data-shell="myroom"] .mg-st-lbl,
#mgPlayView[data-shell="agit"] .mg-st-lbl,
#mgPlayView[data-shell="novel"]:not([data-paper="night"]) .mg-st-lbl {
  color: #1e293b;
}
#mgPlayView[data-shell="community"] .mg-st-delta,
#mgPlayView[data-shell="myroom"] .mg-st-delta,
#mgPlayView[data-shell="agit"] .mg-st-delta,
#mgPlayView[data-shell="novel"]:not([data-paper="night"]) .mg-st-delta {
  background: #fef3c7;
  color: #92400e;
}
#mgPlayView[data-shell="community"] .mg-st-pip,
#mgPlayView[data-shell="myroom"] .mg-st-pip,
#mgPlayView[data-shell="agit"] .mg-st-pip,
#mgPlayView[data-shell="novel"]:not([data-paper="night"]) .mg-st-pip {
  background: #e2e8f0;
  border-color: #cbd5e1;
}
#mgPlayView[data-shell="community"] .mg-st-pip.on,
#mgPlayView[data-shell="myroom"] .mg-st-pip.on,
#mgPlayView[data-shell="agit"] .mg-st-pip.on,
#mgPlayView[data-shell="novel"]:not([data-paper="night"]) .mg-st-pip.on {
  background: #f59e0b;
  border-color: #d97706;
  box-shadow: 0 0 5px rgba(245, 158, 11, 0.45);
}
#mgPlayView[data-shell="community"] .mg-st-track,
#mgPlayView[data-shell="myroom"] .mg-st-track,
#mgPlayView[data-shell="agit"] .mg-st-track,
#mgPlayView[data-shell="novel"]:not([data-paper="night"]) .mg-st-track {
  background: #e2e8f0;
}
#mgPlayView[data-shell="community"] .mg-st-val,
#mgPlayView[data-shell="myroom"] .mg-st-val,
#mgPlayView[data-shell="agit"] .mg-st-val,
#mgPlayView[data-shell="novel"]:not([data-paper="night"]) .mg-st-val {
  color: #78350f;
}

@media (prefers-reduced-motion: reduce) {
  .mg-in, .mg-canvas.shake, .mg-caret::after, .mg-modal, .mg-sheet, .mg-stage-prop { animation: none !important; }
  .mg-bg { transition: none !important; }
}

/* =========================================================
   7. AI 집사 · AI 펫 · 공간 동반자 일러스트 스탠디 & 아바타
   ========================================================= */
.mg-visual-stage {
  height: 224px;
}
.mg-visual-stage.myroom {
  height: 244px;
}
.mg-visual-stage.myroom .mg-stage-prop.pos-lamp {
  right: 12%;
  bottom: 18%;
}

.mg-stage-standees {
  position: absolute;
  top: 38px;
  right: 10px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  z-index: 3;
}
.mg-stage-standee {
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(6px);
  border-radius: 13px;
  padding: 3px 4px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.34);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.mg-stage-standee:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 20px rgba(15, 23, 42, 0.44);
}
.mg-stage-standee.butler {
  border-color: #fde047;
}
.mg-stage-standee.pet {
  border-color: #86efac;
}
.mg-standee-frame {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  overflow: hidden;
  display: block;
  background: #1e293b;
}
.mg-standee-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mg-standee-lbl {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
  padding: 0 2px;
}
.mg-standee-lbl b {
  font-size: 10px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
}
.mg-standee-lbl small {
  font-size: 9px;
  font-weight: 700;
  color: #fde68a;
  white-space: nowrap;
}
.mg-stage-standee.pet .mg-standee-lbl small {
  color: #bbf7d0;
}

.mg-companion-bar.mg-companion-deck {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 8px;
}
.mg-comp-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}
.mg-comp-card.butler {
  background: #fffdf5;
  border-color: #fcd34d;
}
.mg-comp-card.pet {
  background: #f3fdf6;
  border-color: #86efac;
}
.mg-comp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.mg-comp-portrait {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #f59e0b;
  background: #f8fafc;
}
.mg-comp-card.pet .mg-comp-portrait {
  border-color: #22c55e;
}
.mg-comp-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.mg-comp-meta b {
  font-size: 12px;
  font-weight: 800;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mg-comp-meta small {
  font-size: 10.5px;
  font-weight: 700;
  color: #78350f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mg-comp-card.pet .mg-comp-meta small {
  color: #166534;
}
.mg-comp-acts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.mg-comp-acts .mg-comp-btn {
  height: 27px;
  padding: 0 4px;
  font-size: 10.5px;
}

.mg-sa-av.has-img,
.mg-look-av.has-img,
.mg-npc-av.has-img {
  padding: 0;
  overflow: hidden;
}
.mg-look-av.has-img {
  width: 26px;
  height: 26px;
}
.mg-npc-av.has-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(250, 204, 21, 0.65);
}
.mg-npc-av.pet.has-img {
  border-color: rgba(74, 222, 128, 0.75);
}
.mg-sa-av.has-img img,
.mg-look-av.has-img img,
.mg-npc-av.has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.mg-talk-av {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid #f59e0b;
}
.mg-who-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid #e2dccb;
}
.mg-ag-av {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* =========================================================
   정본 살펴보기·상호작용 상세 모달 (LookDetailModal · TakeLookContent · TakeLookButtons 규격)
   ========================================================= */
.mg-look-modal-dim {
  position: absolute;
  inset: 0;
  z-index: 46;
  background: rgba(10, 12, 18, 0.66);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.mg-look-modal {
  width: 100%;
  max-width: 440px;
  max-height: min(88dvh, 720px);
  background: var(--mg-paper);
  border: 1.5px solid var(--mg-ink);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.52);
  animation: mgFadeUp 0.18s ease both;
}
.mg-look-modal-hd {
  flex-shrink: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--mg-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mg-look-modal-hd-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.mg-look-modal-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--mg-honey-soft);
  color: var(--mg-honey-ink);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.mg-look-modal-hd-left b {
  font-size: 15px;
  font-weight: 800;
  color: var(--mg-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mg-look-modal-bd {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  -webkit-overflow-scrolling: touch;
}
.mg-look-hero {
  position: relative;
  width: 100%;
  height: clamp(204px, 31dvh, 252px);
  border-radius: 14px;
  overflow: hidden;
  background: #14161e;
  border: 1px solid rgba(17, 17, 17, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  flex-shrink: 0;
  padding: 0;
}
.mg-look-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(22px) brightness(0.48);
  transform: scale(1.12);
  pointer-events: none;
}
.mg-look-hero-img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: 100%;
  object-fit: contain;
  display: block;
}
.mg-look-zoom-pill {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(12, 14, 20, 0.76);
  color: #f8fafc;
  font-size: 10.5px;
  font-weight: 700;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.mg-look-meta-card {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--mg-surface);
  border: 1px solid var(--mg-line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mg-look-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--mg-ink-2);
}
.mg-look-meta-row strong {
  color: var(--mg-ink);
  font-weight: 800;
}
.mg-look-effect {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--mg-ink);
}
.mg-look-effect-tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--mg-honey-ink);
}
.mg-look-bond-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #e7e5df;
  overflow: hidden;
  margin-top: 2px;
}
.mg-look-bond-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
  transition: width 0.24s ease;
}
.mg-look-desc {
  margin: 0;
  padding: 0 2px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--mg-ink);
  white-space: pre-line;
}
.mg-look-modal-ft {
  flex-shrink: 0;
  padding: 10px 12px calc(11px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--mg-line);
  background: var(--mg-surface);
}
.mg-look-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.mg-look-btn-grid.single-col {
  grid-template-columns: minmax(0, 1fr);
}
.mg-look-choice-btn {
  min-height: 40px;
  padding: 8px 11px;
  border-radius: 11px;
  border: 1.5px solid var(--mg-line-strong);
  background: var(--mg-paper);
  color: var(--mg-ink);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.32;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.14s ease, transform 0.1s ease;
}
.mg-look-choice-btn.span-full {
  grid-column: 1 / -1;
}
.mg-look-choice-btn.align-left {
  justify-content: flex-start;
  text-align: left;
}
.mg-look-choice-btn:hover {
  background: #fffbeb;
}
.mg-look-choice-btn:active {
  transform: scale(0.985);
}
.mg-look-choice-btn.primary {
  background: var(--mg-honey);
  border-color: var(--mg-ink);
  color: var(--mg-ink);
  font-weight: 800;
}
.mg-look-choice-btn.primary:hover {
  background: #f59e0b;
}

.mg-look-lightbox {
  position: absolute;
  inset: 0;
  z-index: 52;
  background: rgba(6, 8, 12, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: zoom-out;
}
.mg-look-lightbox img {
  max-width: 100%;
  max-height: 90%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.65);
}
.mg-look-lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
}

.mg-prop-mini-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--mg-line);
  background: #171921;
}
.mg-prop-mini-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mg-prop-row.is-clickable,
.mg-item-card.is-clickable {
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}
.mg-prop-row.is-clickable:hover,
.mg-item-card.is-clickable:hover {
  background: #fffdf5;
  border-color: var(--mg-ink);
}
