*, *::before, *::after { box-sizing: border-box; }

body {
  background: #fdf8f3;
  color: #3d2e22;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  margin: 0;
  padding-bottom: 80px;
}

/* ── Permission gate ─────────────────────────────────────────── */
#mc-perm {
  position: fixed; inset: 0;
  background: #fffbfe;
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  flex-direction: column;
  gap: 8px;
}
.mc-perm-icon { font-size: 32px; margin-bottom: 4px; }
.mc-perm-msg {
  color: #c4b8d4;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  line-height: 2;
}

/* ── App shell ───────────────────────────────────────────────── */
#mc-app {
  max-width: 440px;
  margin: 0 auto;
  padding: 0 20px 100px;
}

/* ── Page transitions ───────────────────────────────────────── */
@keyframes mc-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes mc-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes mc-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes mc-slide-right { from { transform: translateX(100%); } to { transform: translateX(0); } }
.mc-trans-slide-up { animation: mc-slide-up 0.2s ease-out; }
.mc-trans-fade { animation: mc-fade-in 0.3s ease; }
.mc-trans-slide-right { animation: mc-slide-right 0.25s ease; }

/* ── Responsive desktop ─────────────────────────────────────── */
@media (min-width: 768px) {
  #mc-app { max-width: 480px; font-size: 1.1em; }
  .mc-bottom-nav {
    left: 50%; right: auto;
    width: 480px;
    transform: translateX(-50%);
  }
}
.mc-view { display: none; }
.mc-view.active { display: block; }

/* ── Responsive breakpoints ──────────────────────────────────── */

/* Tablet: 640px+ */
@media (min-width: 640px) {
  #mc-app {
    max-width: 600px;
    padding: 0 32px 120px;
  }
  .mc-headline { font-size: 28px; }
  .mc-card { padding: 24px; border-radius: 24px; }
  .mc-textarea { font-size: 16px; min-height: 112px; }
  .mc-realm-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .mc-realm-chip { padding: 12px 8px; }
  .mc-realm-icon { font-size: 24px; }
  .mc-pet-avatar { width: 100px; height: 100px; }
  .mc-pet-name { font-size: 30px; }
  .mc-idcard-body { gap: 18px; }
  .mc-idcard-photo { width: 100px; height: 100px; }
  .mc-name-input { font-size: 20px; }
  .mc-tl-img { max-height: 280px; object-fit: cover; }
  .mc-story-img { max-height: 240px; object-fit: cover; }
  .mc-observe-img { max-height: 320px; object-fit: cover; }
}

/* Dashboard grid — single column by default */
.mc-dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.mc-dash-grid > .mc-module {
  min-width: 0;
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
  #mc-app {
    max-width: 780px;
    padding: 0 40px 140px;
  }

  /* Dashboard 2-column */
  .mc-dash-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .mc-headline { font-size: 32px; }
  .mc-sub { font-size: 14px; }
  .mc-card { padding: 28px; border-radius: 28px; }
  .mc-textarea { font-size: 16px; min-height: 120px; padding: 16px 18px; }

  /* World selector single row on desktop */
  .mc-realm-grid { grid-template-columns: repeat(6, 1fr); gap: 10px; }
  .mc-realm-chip { padding: 14px 8px; }
  .mc-realm-icon { font-size: 26px; }
  .mc-realm-name { font-size: 12px; }

  /* Dashboard 2-column grid */
  .mc-dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .mc-dash-full {
    grid-column: 1 / -1;
  }

  /* Genesis wider form */
  #view-genesis { padding-top: 48px; }
  .mc-genesis-hero { padding: 12px 0 40px; }
  .mc-genesis-emoji { font-size: 64px; }

  /* ID card wider */
  #view-idcard { padding-top: 48px; }
  .mc-idcard { max-width: 560px; margin-left: auto; margin-right: auto; }

  /* Pet hero larger */
  .mc-pet-avatar { width: 112px; height: 112px; }
  .mc-pet-name { font-size: 36px; }
  .mc-pet-hero { margin-bottom: 36px; position: relative; }

  /* Timeline images */
  .mc-tl-img { max-height: 340px; object-fit: cover; }
  .mc-story-img { max-height: 280px; object-fit: cover; }
  .mc-observe-img { max-height: 380px; object-fit: cover; }

  /* Buttons */
  .mc-btn { font-size: 15px; padding: 18px; }
}

/* ── Gradient header bar ─────────────────────────────────────── */
.mc-blob-header {
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, #f9a8c9, #c4a0e8, #93d0e8, #a8e4c8);
  border-radius: 0 0 12px 12px;
  margin-bottom: 0;
}

/* ── Typography ──────────────────────────────────────────────── */
.mc-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #b09a86;
  background: transparent;
  border-radius: 0;
  padding: 0;
  letter-spacing: 0;
  text-transform: none;
}
.mc-headline {
  font-size: 24px;
  font-weight: 500;
  color: #3d2e22;
  line-height: 1.25;
  letter-spacing: -0.3px;
}
.mc-sub {
  font-size: 13px;
  color: #b09a86;
  line-height: 1.6;
}

/* ── Card ────────────────────────────────────────────────────── */
.mc-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(180,140,110,0.15);
  padding: 20px;
  margin-bottom: 16px;
}

/* ── Genesis ─────────────────────────────────────────────────── */
#view-genesis { padding-top: 36px; }
.mc-genesis-hero { text-align: center; padding: 8px 0 32px; }
.mc-genesis-emoji { font-size: 52px; margin-bottom: 12px; display: block; }

.mc-field { margin-bottom: 20px; }
.mc-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #7a6888;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}
.mc-textarea {
  width: 100%;
  background: #fdf5ff;
  border: 2px solid #ecddf8;
  border-radius: 14px;
  color: #3d2d50;
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  line-height: 1.6;
  padding: 14px 16px;
  resize: none;
  min-height: 96px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.mc-textarea::placeholder { color: #cbb8e0; }
.mc-textarea:focus {
  outline: none;
  border-color: #c07cd8;
  box-shadow: 0 0 0 3px rgba(192,124,216,0.12);
}

.mc-chips { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 7px; }
.mc-chip {
  background: #fdf0ff;
  border: 1.5px solid #e8d0f8;
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  color: #a070c8;
  cursor: pointer;
  transition: all 0.14s;
  user-select: none;
}
.mc-chip:hover { background: #f5e0ff; border-color: #c8a0e8; }
.mc-chip:active { transform: scale(0.96); }

/* Upload */
.mc-upload-optional {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #b8a8c8;
  background: #f5eeff;
  padding: 2px 7px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: middle;
}
.mc-upload-hint {
  font-size: 12px;
  color: #a898b8;
  line-height: 1.55;
  margin-bottom: 10px;
}
.mc-upload-drop {
  border: 2px dashed #dcc8f0;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  background: #fdf8ff;
}
.mc-upload-drop:hover { border-color: #c07cd8; background: #fbf0ff; }
.mc-upload-drop input {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.mc-upload-drop-icon { font-size: 22px; margin-bottom: 4px; }
.mc-upload-drop-text { font-size: 12px; font-weight: 600; color: #b090d0; }
.mc-upload-preview {
  margin-top: 10px; display: none;
  position: relative; border-radius: 14px; overflow: hidden;
}
.mc-upload-preview img {
  width: 100%; max-height: 180px; object-fit: cover; display: block;
}
.mc-upload-clear {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,0.85);
  color: #a080c0;
  border: none; border-radius: 50%;
  width: 26px; height: 26px;
  cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ── Realm / World selector ──────────────────────────────────── */
.mc-realm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mc-realm-chip {
  background: #fdf8ff;
  border: 2px solid #e8d4f8;
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.mc-realm-chip:hover {
  border-color: #c8a4e8;
  background: #fbf0ff;
  transform: translateY(-1px);
}
.mc-realm-chip:active {
  transform: scale(0.96);
}
.mc-realm-chip.selected {
  border-color: #c07cd8;
  background: linear-gradient(135deg, #fce0f8, #f0dcff);
  box-shadow: 0 2px 12px rgba(192,124,216,0.20);
}
.mc-realm-icon {
  font-size: 22px;
  display: block;
}
.mc-realm-name {
  font-size: 11px;
  font-weight: 700;
  color: #5a3a7a;
  line-height: 1.3;
}
.mc-realm-desc {
  font-size: 10px;
  color: #b090d0;
  font-weight: 500;
}
@media (max-width: 380px) {
  .mc-realm-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Buttons ─────────────────────────────────────────────────── */
.mc-btn {
  display: block; width: 100%;
  border-radius: 50px;
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.5px;
  padding: 16px; cursor: pointer;
  transition: all 0.18s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-align: center;
  border: none;
}
.mc-btn-primary {
  background: linear-gradient(135deg, #f4a0bf 0%, #c490e8 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(200,120,210,0.30);
}
.mc-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(200,120,210,0.38); }
.mc-btn-primary:active { transform: translateY(0); }
.mc-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.mc-btn-ghost {
  background: #ffffff;
  color: #b090d0;
  border: 2px solid #e8d4f8;
}
.mc-btn-ghost:hover { border-color: #c8a4e8; color: #9870c0; }
.mc-btn-stack { display: flex; flex-direction: column; gap: 10px; }

/* ── Loading screen ──────────────────────────────────────────── */
.mc-loading-screen { padding: 72px 0; text-align: center; }
.mc-loading-emoji {
  font-size: 40px;
  display: block;
  margin: 0 auto 16px;
  animation: mc-bounce 1.4s ease-in-out infinite;
}
@keyframes mc-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.mc-loading-dots {
  display: flex; justify-content: center; gap: 6px;
  margin: 0 auto 16px;
}
.mc-loading-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f4a0bf, #c490e8);
  animation: mc-dot 1.2s ease-in-out infinite;
}
.mc-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.mc-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes mc-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}
.mc-loading-title {
  font-size: 16px; font-weight: 700; color: #7a5898;
  margin-bottom: 6px;
}
.mc-loading-desc {
  font-size: 13px; color: #b0a0c0; line-height: 1.6;
  max-width: 260px; margin: 0 auto;
}

/* ── ID Card ─────────────────────────────────────────────────── */
#view-idcard { padding-top: 36px; }
.mc-idcard {
  background: linear-gradient(145deg, #fff5fb 0%, #f5eeff 100%);
  border: 2px solid #edd8f8;
  border-radius: 20px;
  overflow: hidden;
  margin: 20px 0;
  box-shadow: 0 4px 20px rgba(180,100,210,0.10);
}
.mc-idcard-header {
  background: linear-gradient(90deg, #f4a0bf, #c490e8);
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mc-idcard-series {
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(255,255,255,0.85);
}
.mc-idcard-no {
  font-size: 11px; color: rgba(255,255,255,0.75);
  font-family: monospace; letter-spacing: 1px;
}
.mc-idcard-body { padding: 18px; display: flex; gap: 15px; align-items: flex-start; }
.mc-idcard-photo {
  flex-shrink: 0; width: 88px; height: 88px;
  border-radius: 14px; overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(180,100,210,0.18);
}
.mc-idcard-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mc-idcard-info { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mc-name-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid #e8d4f8;
  color: #3d2d50;
  font-size: 18px; font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding: 3px 0 6px; width: 100%;
  transition: border-color 0.15s;
}
.mc-name-input::placeholder { color: #d8c8e8; }
.mc-name-input:focus { outline: none; border-bottom-color: #c07cd8; }
.mc-meta-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.mc-meta-tag {
  font-size: 10px; font-weight: 600;
  color: #a070c0;
  background: rgba(200,150,240,0.12);
  border: 1.5px solid #dcc8f0;
  border-radius: 20px;
  padding: 3px 9px;
}
/* anchor generating sub-view inside idcard */
.mc-idcard-anchor {
  padding: 28px 18px;
  text-align: center;
}

/* ── Dashboard ───────────────────────────────────────────────── */
#view-dashboard { padding-top: 16px; }

/* ── Status bar ──────────────────────────────────────────────── */
.mc-status-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 14px;
  font-size: 12px; color: #b09a86;
}
.mc-status-time-text { font-weight: 500; }
.mc-status-signal { font-size: 11px; letter-spacing: 1px; }

/* ── Pet Hero ────────────────────────────────────────────────── */
.mc-pet-hero { text-align: center; margin-bottom: 20px; position: relative; }
.mc-pet-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 12px rgba(180,140,110,0.15);
  object-fit: cover;
  display: block;
  margin: 0 auto 10px;
}
.mc-pet-name {
  font-size: 20px; font-weight: 500;
  color: #3d2e22;
  margin-bottom: 4px;
}
.mc-pet-meta { font-size: 12px; color: #b09a86; }
.mc-pet-companion {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 8px;
  background: #fff;
  border: 1px solid #f0e6da;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px; color: #8a7a6a;
}
.mc-pet-companion strong { color: #c4633a; font-weight: 600; margin: 0 2px; }

/* ── Avatar ring + status ───────────────────────────────────── */
.mc-avatar-ring {
  position: relative; display: inline-block;
  width: 80px; height: 80px; margin: 0 auto 10px;
  background: #f0e6da; border-radius: 50%;
}
.mc-avatar-ring .mc-pet-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 12px rgba(180,140,110,0.15);
  object-fit: cover;
}
.mc-avatar-status {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 14px; height: 14px;
  background: #a8d5a2;
  border-radius: 50%;
  border: 2px solid #fff;
  transition: all 0.4s;
  font-size: 0;
}
.mc-avatar-ring.away .mc-avatar-status { background: #f0a070; }
.mc-avatar-ring.returning .mc-avatar-status { background: #a8d5a2; }

/* ── Bond bar ────────────────────────────────────────────────── */
.mc-bond-bar {
  background: #fff;
  border: 1px solid #f0e6da;
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.mc-bond-top {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: #6b5d4e;
  margin-bottom: 6px;
}
.mc-bond-lv {
  margin-left: auto;
  font-size: 11px; color: #d4856e;
  background: #fde8d8; padding: 2px 8px; border-radius: 10px;
}
.mc-bond-track {
  height: 5px;
  background: #f5ede4;
  border-radius: 3px;
  overflow: hidden;
}
.mc-bond-fill {
  height: 100%;
  background: linear-gradient(90deg, #f4b8a0, #e8857a);
  border-radius: 3px;
  transition: width 0.6s ease;
}
.mc-bond-label {
  font-size: 10px; color: #b09a86; margin-top: 4px;
}

/* ── Envelope card ───────────────────────────────────────────── */
.mc-env-card {
  background: #fffaf6;
  border: 1.5px solid #f4d0b0;
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, #f4a882, #f0c090) 1;
  border-radius: 18px;
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 0.15s;
  flex: 1; min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mc-env-card:active { transform: scale(0.98); }
.mc-env-icon-wrap {
  width: 40px; height: 40px;
  background: #fde8d8;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  position: relative;
  flex-shrink: 0;
}
.mc-env-dot {
  position: absolute; top: -2px; right: -2px;
  width: 9px; height: 9px;
  background: #e87a5a;
  border-radius: 50%;
  border: 2px solid #fff;
}
.mc-env-title {
  font-size: 14px; font-weight: 600; color: #3d2e22;
}
.mc-env-sub {
  font-size: 11px; color: #b09a86;
  font-style: italic;
}
.mc-env-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mc-env-time {
  font-size: 11px; color: #b09a86;
  flex-shrink: 0;
  align-self: center;
}

/* ── Status card ──────────────────────────────────────────────── */
.mc-dash-status-card {
  background: #fff;
  border: 1px solid #f0e6da;
  border-radius: 18px;
  padding: 16px;
  padding-bottom: 0;
  flex: 1; min-width: 0;
  position: relative;
  min-height: 160px;
}

.mc-status-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-right: 120px;
}

.mc-status-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mc-status-label {
  font-size: 11px;
  color: #b09a86;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.mc-status-icon {
  font-size: 24px;
}

.mc-status-title {
  font-size: 16px;
  font-weight: 700;
  color: #3d2e22;
}

.mc-status-desc {
  font-size: 12px;
  color: #b09a86;
  line-height: 1.4;
  max-width: 160px;
}

.mc-status-action {
  display: flex;
  align-items: flex-start;
  padding-top: 4px;
}

.mc-status-bottom {
  position: absolute;
  right: 0;
  bottom: 0;
}

#mc-pet-stage {
  position: relative;
  width: 110px;
  height: 160px;
  overflow: visible;
}

.mc-expedition-btn {
  margin-top: 8px;
  display: inline-block;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(135deg, #f9a8d4, #c084fc);
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
  white-space: nowrap;
}
.mc-expedition-btn:active {
  transform: scale(0.95);
}
.mc-expedition-ready {
  background: linear-gradient(135deg, #34d399, #60a5fa);
  box-shadow: 0 2px 8px rgba(52, 211, 153, 0.3);
  animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 2px 8px rgba(52, 211, 153, 0.3); }
  50% { box-shadow: 0 2px 16px rgba(52, 211, 153, 0.6); }
}

.mc-return-countdown {
  margin-top: 8px;
  font-size: 12px;
  color: #a78bfa;
}

/* ── Cards column ──────────────────────────────────────────────── */
.mc-dash-cards {
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px;
}

/* ── Dual action buttons ──────────────────────────────────────── */
.mc-dash-actions {
  display: flex; gap: 12px; margin-bottom: 16px;
}
.mc-dash-action {
  flex: 1;
  background: #fff;
  border: 1px solid #f0e6da;
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  transition: all 0.15s;
}
.mc-dash-action:active { transform: scale(0.98); }
.mc-dash-action-icon {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.mc-dash-action-icon.whisper { background: #fde8da; }
.mc-dash-action-icon.expedition { background: #dff0e0; }
.mc-dash-action-body { min-width: 0; }
.mc-dash-action-title {
  font-size: 13px; font-weight: 600; color: #3d2e22;
  margin-bottom: 2px;
}
.mc-dash-action-sub {
  font-size: 10px; color: #b09a86; line-height: 1.3;
}
.mc-dash-action.expedition-ready {
  border-color: #d4c0a8;
  background: #fffaf6;
}
.mc-dash-action.expedition-ready .mc-dash-action-sub { color: #7a9a6a; }

/* ── Bottom navigation ────────────────────────────────────────── */
.mc-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(253,248,243,0.97);
  border-top: 1px solid #f0e6da;
  display: flex;
  z-index: 500;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mc-nav-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 3px;
  padding: 10px 0;
  font-size: 10px; font-weight: 600;
  color: #b09a86;
  cursor: pointer;
  border: none; background: none;
  font-family: inherit;
  transition: all 0.15s;
}
.mc-nav-tab.active {
  color: #d4694a;
  background: #fde8da;
}
.mc-nav-tab-icon { font-size: 20px; }

/* ── Chat overlay ────────────────────────────────────────────── */
.mc-chat-overlay {
  position: fixed; inset: 0;
  background: #fdf8f3;
  z-index: 9999;
  display: flex; flex-direction: column;
  animation: mc-chat-in 0.2s ease-out;
}
@keyframes mc-chat-in {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* Chat nav */
.mc-chat-nav {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0e6da;
  background: #fdf8f3;
  flex-shrink: 0;
}
.mc-chat-back {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #f0e6da;
  font-size: 22px; color: #8a7a6a;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
.mc-chat-nav-pet {
  display: flex; align-items: center; gap: 8px; flex: 1;
}
.mc-chat-nav-avatar-wrap {
  position: relative; width: 36px; height: 36px; flex-shrink: 0;
}
.mc-chat-nav-avatar {
  width: 36px; height: 36px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid #fff;
}
.mc-chat-nav-dot {
  position: absolute; bottom: 0; right: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #a8d5a2;
}
.mc-chat-nav-dot.away { background: #f0a070; }
.mc-chat-nav-name { font-size: 15px; font-weight: 700; color: #3d2e22; }
.mc-chat-nav-sub { font-size: 11px; color: #b09a86; margin-top: 1px; }

/* Messages area */
.mc-chat-msgs {
  flex: 1; overflow-y: auto;
  padding: 16px 14px;
  display: flex; flex-direction: column;
  gap: 8px;
}

/* Time divider */
.mc-chat-divider {
  text-align: center;
  font-size: 11px; color: #c4a98a;
  padding: 12px 0 6px;
  display: flex; align-items: center; gap: 10px;
}
.mc-chat-divider::before, .mc-chat-divider::after {
  content: ''; flex: 1; height: 1px; background: #f0e6da;
}

/* Pet message — letter card */
.mc-chat-msg-pet {
  display: flex; align-items: flex-end; gap: 8px;
  max-width: 260px;
}
.mc-chat-msg-pet-avatar {
  width: 30px; height: 30px;
  border-radius: 50%; object-fit: cover;
  flex-shrink: 0; align-self: flex-end;
}
.mc-chat-msg-card {
  background: #fffaf5;
  border: 1.5px solid #f4d0b0;
  border-radius: 16px 16px 16px 5px;
  overflow: hidden;
  max-width: 230px;
}
.mc-chat-msg-card-type {
  background: #fde8d4;
  padding: 5px 10px;
  font-size: 10px; font-weight: 700; color: #c4694a;
  display: flex; align-items: center; gap: 5px;
}
.mc-chat-msg-card-body {
  padding: 10px 13px;
  font-size: 13px; color: #5a4030;
  line-height: 1.7;
  font-style: italic;
}
.mc-chat-msg-time {
  font-size: 10px; color: #c4a98a;
  margin-top: 3px; padding-left: 38px;
}

/* Pet message — photo card */
.mc-chat-msg-photo-card {
  background: #fff;
  border: 1.5px solid #f0e6da;
  border-radius: 16px 16px 16px 5px;
  overflow: hidden;
  max-width: 210px;
}
.mc-chat-msg-photo-img {
  width: 100%; height: 140px;
  object-fit: cover; display: block;
}
.mc-chat-msg-photo-desc {
  padding: 8px 11px;
  font-size: 12px; font-style: italic; color: #6b5040;
  line-height: 1.5;
}
.mc-chat-msg-photo-time {
  font-size: 10px; color: #c4a98a;
  padding: 0 11px 8px;
}

/* User message */
.mc-chat-msg-user {
  display: flex; flex-direction: column;
  align-items: flex-end;
  max-width: 240px;
  align-self: flex-end;
}
.mc-chat-msg-user-bubble {
  background: #fde8d8;
  border: 1px solid #f4d0b8;
  border-radius: 18px 18px 5px 18px;
  padding: 9px 14px;
  font-size: 13px; color: #5a3020;
  line-height: 1.5;
  max-width: 220px;
}
.mc-chat-msg-user-time {
  font-size: 10px; color: #c4a98a;
  margin-top: 3px;
}

/* Pet real-time reply — conversational bubble (not a letter card) */
.mc-chat-msg-reply-bubble {
  background: #fffaf5;
  border: 1.5px solid #f4d0b0;
  border-radius: 16px 16px 16px 5px;
  padding: 9px 14px;
  font-size: 13px; color: #5a4030;
  line-height: 1.6;
  max-width: 220px;
}

/* Typing indicator */
.mc-chat-typing { align-items: center; }
.mc-chat-typing-dots {
  background: #fffaf5;
  border: 1.5px solid #f4d0b0;
  border-radius: 16px 16px 16px 5px;
  padding: 11px 14px;
  display: flex; gap: 5px; align-items: center;
}
.mc-chat-typing-dots span {
  width: 7px; height: 7px;
  background: #e0a878;
  border-radius: 50%;
  display: inline-block;
  animation: mc-typing-bounce 1.3s ease-in-out infinite;
}
.mc-chat-typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.mc-chat-typing-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes mc-typing-bounce {
  0%, 70%, 100% { transform: translateY(0); opacity: 0.45; }
  35% { transform: translateY(-5px); opacity: 1; }
}

/* Bottom input */
.mc-chat-input-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
  border-top: 1px solid #f0e6da;
  background: #fdf8f3;
  flex-shrink: 0;
}
.mc-chat-input {
  flex: 1;
  background: #fff;
  border: 1px solid #f0e6da;
  border-radius: 22px;
  padding: 9px 14px;
  font-size: 14px; color: #3d2e22;
  font-family: inherit;
  outline: none;
}
.mc-chat-input::placeholder { color: #c4a98a; }
.mc-chat-input:focus { border-color: #f4d0b0; }
.mc-chat-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #f4c4a8;
  border: none;
  color: #c45030;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  opacity: 0.45;
  transition: opacity 0.15s;
}
.mc-chat-send.active { opacity: 1; }

/* ── Chat loading ─────────────────────────────────────────── */
.mc-chat-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 40px 0;
  flex-direction: column;
}
.mc-chat-loading-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #d4c4b0;
  animation: mc-chat-loading-bounce 1.2s ease-in-out infinite;
}
.mc-chat-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.mc-chat-loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes mc-chat-loading-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}
.mc-chat-loading-text {
  font-size: 12px; color: #b09a86;
  margin-top: 8px;
}

/* ── Chat pagination ───────────────────────────────────────── */
.mc-chat-loading-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px 0;
}
.mc-chat-loading-top .mc-chat-loading-dot {
  width: 5px; height: 5px;
}
.mc-chat-top-end {
  text-align: center;
  font-size: 11px;
  color: #c4a98a;
  padding: 12px 0 4px;
}

/* ── Temperament card ────────────────────────────────────────── */
.mc-vitals-card {
  background: #fff;
  border: 1px solid #f0e6da;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
}
.mc-vitals-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.mc-vitals-kicker {
  font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: #b09a86; margin-bottom: 2px;
}
.mc-vitals-head h2 {
  font-size: 16px; font-weight: 600;
  color: #3d2e22; margin: 0;
}
#mc-fingerprint {
  font-size: 13px; font-weight: 800;
  color: #d4c4b0; letter-spacing: 1.5px;
  font-family: monospace;
}
.mc-vitals-desc {
  font-size: 12px; color: #8a7a6a;
  line-height: 1.6;
}

/* ── Expedition overlay ──────────────────────────────────────── */
.mc-exp-overlay {
  position: fixed; inset: 0;
  background: #fdf8f3;
  z-index: 9999;
  display: flex; flex-direction: column;
  animation: mc-chat-in 0.2s ease-out;
}
.mc-exp-nav {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0e6da;
  background: #fdf8f3;
  flex-shrink: 0;
}
.mc-exp-body {
  flex: 1; overflow-y: auto; padding: 16px 14px 40px;
}
.mc-exp-section-title {
  font-size: 13px; font-weight: 600; color: #6b5d4e;
  margin-bottom: 12px;
}

/* Item grid */
.mc-exp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.mc-exp-item {
  background: #fff;
  border: 1.5px solid #f0e6da;
  border-radius: 14px;
  padding: 10px 6px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.mc-exp-item:active { transform: scale(0.95); }
.mc-exp-item-emoji { font-size: 22px; display: block; margin-bottom: 4px; }
.mc-exp-item-name { font-size: 10px; color: #9a7a62; font-weight: 500; }
.mc-exp-item.selected {
  background: #fff9f6;
  border-color: #d4856e;
}
.mc-exp-item.selected .mc-exp-item-name { color: #c4633a; }
.mc-exp-item.selected::after {
  content: '';
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px;
  background: #d4856e;
  border-radius: 50%;
}
.mc-exp-item.disabled {
  opacity: 0.38; cursor: default; pointer-events: none;
}

/* Selected bar */
.mc-exp-selected {
  background: #fff;
  border: 1px solid #f0e6da;
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px;
}
.mc-exp-sel-label {
  font-size: 11px; font-weight: 700; color: #b09a86;
  flex-shrink: 0;
}
.mc-exp-sel-items {
  font-size: 12px; color: #6b5d4e;
  display: flex; flex-wrap: wrap; gap: 4px;
}
.mc-exp-sel-chip {
  background: #fde8d8;
  color: #c4633a;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
}

/* Hint box */
.mc-exp-hint {
  display: flex; gap: 8px;
  background: #fff9f6;
  border: 1px solid #f4d0b0;
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 12px; color: #8a6a5a;
  line-height: 1.5;
}

/* Go button */
.mc-exp-go {
  width: 100%;
  padding: 14px 0;
  background: #3d2e22;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 15px; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}
.mc-exp-go:disabled { opacity: 0.4; cursor: not-allowed; }

/* Departure screen */
.mc-depart-screen {
  position: fixed; inset: 0;
  background: #1a1420;
  z-index: 10000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  padding: 40px 20px;
}
.mc-depart-rings {
  position: relative;
  width: 140px; height: 140px;
  display: flex; align-items: center; justify-content: center;
}
.mc-depart-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(180,140,220,0.15);
}
.mc-depart-ring.r1 { width: 130px; height: 130px; }
.mc-depart-ring.r2 { width: 160px; height: 160px; border-color: rgba(180,140,220,0.08); }
.mc-depart-avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.2);
  object-fit: cover; z-index: 1;
}
.mc-depart-name {
  font-size: 20px; font-weight: 700; color: #fff;
}
.mc-depart-msg {
  font-size: 13px; font-style: italic; color: #8a7a9a;
  text-align: center; line-height: 1.6;
}
.mc-depart-items {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center;
}
.mc-depart-item-chip {
  background: rgba(255,255,255,0.1);
  color: #c4b0d8;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 10px;
}
.mc-depart-hint {
  font-size: 11px; color: #5a4a68;
  margin-top: 8px;
}

/* ── Old Expedition (keep for backward compat) ───────────────── */
.exp-dot { background: #f4a060 !important; }
.mc-exp-desc { font-size: 12px; color: #9b8aac; text-align: center; margin-bottom: 12px; line-height: 1.6; }
.mc-intention {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fffaf0;
  border: 1.5px solid #f0dfb8;
  border-radius: 14px;
  padding: 11px 12px;
  margin-bottom: 12px;
}
.mc-intention > span {
  font-size: 22px;
  line-height: 1;
}
.mc-intention b {
  color: #80623a;
  display: block;
  font-size: 12px;
  margin-bottom: 2px;
}
.mc-intention p {
  color: #a78a58;
  font-size: 11px;
  line-height: 1.45;
}
.mc-exp-items {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-bottom: 12px;
}
.mc-exp-item {
  width: 64px; height: 64px;
  background: #fdf8ff;
  border: 2px solid #edd8f8;
  border-radius: 14px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  position: relative;
}
.mc-exp-item:hover { border-color: #c490e8; background: #fbf0ff; transform: translateY(-2px); }
.mc-exp-item.selected {
  border-color: #f4a0bf;
  background: linear-gradient(135deg, #fff0f5, #ffe0f0);
  box-shadow: 0 2px 12px rgba(244,160,191,0.25);
}
/* .mc-exp-item.selected::after removed — new spec overrides this in the main section above */
.mc-exp-item-name { font-size: 9px; color: #a898b8; font-weight: 600; margin-top: 2px; }
.mc-exp-cost { font-size: 11px; color: #a898b8; text-align: center; margin-bottom: 10px; }
.mc-exp-cost.affordable { color: #6a9a5a; font-weight: 700; }
.mc-exp-send { max-width: 240px; margin: 0 auto; }
.mc-exp-travel { text-align: center; padding: 16px 0; }
.mc-exp-travel-emoji { font-size: 36px; display: block; margin-bottom: 12px; animation: mc-bounce 2s ease-in-out infinite; }
.mc-exp-travel-title { font-size: 14px; font-weight: 700; color: #7a5898; margin: 10px 0; }
.mc-exp-travel-countdown { font-size: 12px; color: #b0a0c0; }

/* ── Vignette overlays ───────────────────────────────────────── */
.mc-vignette {
  position: fixed; inset: 0;
  background: rgba(30,10,40,0.85);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: none;
  align-items: center; justify-content: center;
  flex-direction: column;
}
.mc-vignette.show {
  display: flex;
  animation: mc-vignette-in 0.5s ease-out;
}
@keyframes mc-vignette-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.mc-vignette-content {
  text-align: center;
  color: #fff;
  padding: 32px;
  animation: mc-vignette-up 0.6s ease-out;
}
@keyframes mc-vignette-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.mc-vignette-emoji {
  font-size: 64px; display: block; margin-bottom: 16px;
  animation: mc-bounce 1.6s ease-in-out infinite;
}
.mc-vignette-title { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.mc-vignette-desc { font-size: 14px; color: #c8b8e8; margin-bottom: 20px; line-height: 1.6; max-width: 280px; }
.mc-vignette-items {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.mc-vignette-item {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 12px;
  font-size: 28px;
  animation: mc-pop-in 0.4s ease-out both;
}
.mc-vignette-item:nth-child(2) { animation-delay: 0.15s; }
.mc-vignette-item:nth-child(3) { animation-delay: 0.3s; }
@keyframes mc-pop-in {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}
.mc-vignette-souvenir {
  margin-bottom: 20px;
}
.mc-vignette-souvenir img {
  max-width: 200px; max-height: 200px;
  border-radius: 16px;
  border: 3px solid rgba(255,255,255,0.25);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.mc-vignette-token {
  width: 180px;
  min-height: 160px;
  margin: 0 auto;
  border-radius: 18px;
  border: 2px solid rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px;
}
.mc-vignette-token span { font-size: 54px; }
.mc-vignette-token small {
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
}
.mc-vignette-btn { max-width: 240px; margin: 0 auto; }

/* ── Particles canvas ────────────────────────────────────────── */
#mc-particles {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  width: 160px; height: 160px;
  pointer-events: none;
  z-index: 0;
}

/* Module */
.mc-module { margin-bottom: 16px; }
.mc-module-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.mc-module-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.mc-module-title {
  font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
}

.mc-mod-observe .mc-module-dot { background: #f4a0bf; }
.mc-mod-observe .mc-module-title { color: #e07898; }
.mc-mod-influence .mc-module-dot { background: #c490e8; }
.mc-mod-influence .mc-module-title { color: #9a60c8; }
.mc-mod-archive .mc-module-dot { background: #93d0e8; }
.mc-mod-archive .mc-module-title { color: #5898c0; }
.mc-mod-story .mc-module-dot { background: #f9a8c9; }
.mc-mod-story .mc-module-title { color: #d87888; }

/* Life log */
.mc-life-empty {
  color: #c0a8d0;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  padding: 10px 0 16px;
}
.mc-life-item {
  display: flex;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #f2e4f8;
  border-radius: 14px;
  padding: 11px 12px;
  margin-bottom: 10px;
}
.mc-life-item > span {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
}
.mc-life-item p {
  color: #8b7a98;
  font-size: 12px;
  line-height: 1.5;
}
.mc-life-item small {
  color: #c4b0d8;
  display: block;
  font-size: 10px;
  margin-top: 3px;
}

/* Story timeline */
.mc-story-item {
  display: flex; gap: 10px;
  padding-bottom: 16px; position: relative;
}
.mc-story-item::after {
  content: ''; position: absolute;
  left: 18px; top: 22px; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #f8d0e8 0%, transparent 100%);
}
.mc-story-item:last-child::after { display: none; }
.mc-story-icon {
  flex-shrink: 0; width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.mc-story-icon.whisper { background: #f5e0ff; }
.mc-story-icon.observation { background: #fce0e8; }
.mc-story-icon.origin { background: #e0f0ff; }
.mc-story-body { flex: 1; min-width: 0; }
.mc-story-text {
  font-size: 12px; font-weight: 500;
  color: #9080a8; line-height: 1.55;
}
.mc-story-ts {
  font-size: 10px; font-weight: 500;
  color: #c4b0d8; margin-bottom: 3px;
}
.mc-story-img {
  width: 100%; border-radius: 12px; display: block;
  margin-top: 6px;
  box-shadow: 0 3px 12px rgba(180,100,210,0.10);
  cursor: pointer;
}
.mc-story-empty {
  font-size: 13px; font-weight: 500;
  color: #c8b8d8;
  text-align: center; padding: 12px 0;
  display: none;
}

/* Observe */
.mc-observe-img-wrap {
  border-radius: 16px; overflow: hidden;
  margin-bottom: 10px;
  box-shadow: 0 4px 18px rgba(180,100,210,0.10);
}
.mc-observe-img { width: 100%; display: block; cursor: pointer; }
.mc-observe-date {
  font-size: 11px; font-weight: 600;
  color: #c4b0d8; margin-bottom: 5px;
}
.mc-observe-event {
  font-size: 13px; font-weight: 500;
  color: #9080a8; line-height: 1.6;
  margin-bottom: 16px;
}
/* Influence */
.mc-whisper-input {
  width: 100%;
  background: #fdf8ff;
  border: 2px solid #edd8f8;
  border-radius: 14px;
  color: #3d2d50;
  font-size: 14px; font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding: 13px 16px;
  margin-bottom: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.mc-whisper-input::placeholder { color: #d0c0e4; }
.mc-whisper-input:focus {
  outline: none;
  border-color: #c07cd8;
  box-shadow: 0 0 0 3px rgba(192,124,216,0.10);
}
.mc-whisper-btn {
  background: linear-gradient(135deg, #ede0ff, #fce8f2);
  border: 2px solid #dcc8f0;
  border-radius: 50px; color: #9868c0;
  font-size: 13px; font-weight: 700;
  padding: 10px 20px; cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: all 0.14s;
}
.mc-whisper-btn:hover { border-color: #c498e8; transform: translateY(-1px); }
.mc-whisper-saved {
  font-size: 12px; font-weight: 600;
  color: #b898d0; margin-top: 10px;
  display: none;
}
.mc-pending-row {
  display: none; margin-top: 12px;
  padding: 11px 14px;
  background: linear-gradient(135deg, #fdf0ff, #f5eaff);
  border: 1.5px solid #e4d0f8;
  border-radius: 12px;
}
.mc-pending-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: #c0a0d8; margin-bottom: 3px;
}
.mc-pending-text { font-size: 12px; font-weight: 500; color: #9878b8; }

/* Archive timeline */
.mc-tl-empty {
  font-size: 13px; font-weight: 500;
  color: #c8b8d8;
  text-align: center; padding: 16px 0;
}
.mc-tl-item {
  display: flex; gap: 12px;
  padding-bottom: 22px; position: relative;
}
.mc-tl-item::after {
  content: ''; position: absolute;
  left: 30px; top: 20px; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #edd8f8 0%, transparent 100%);
}
.mc-tl-item:last-child::after { display: none; }
.mc-tl-left { flex-shrink: 0; width: 28px; text-align: right; padding-top: 2px; }
.mc-tl-date { font-size: 10px; font-weight: 600; color: #c4b0d8; line-height: 1.4; }
.mc-tl-dot-col {
  flex-shrink: 0; width: 14px;
  display: flex; justify-content: center; padding-top: 4px;
}
.mc-tl-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, #f4a0bf, #c490e8);
  box-shadow: 0 0 0 3px rgba(200,150,230,0.18);
}
.mc-tl-body { flex: 1; min-width: 0; }
.mc-tl-img {
  width: 100%; border-radius: 14px; display: block;
  margin-bottom: 7px;
  box-shadow: 0 3px 12px rgba(180,100,210,0.10);
  cursor: pointer;
}
.mc-tl-desc { font-size: 12px; font-weight: 500; color: #a090b8; line-height: 1.55; }

.mc-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, #f0deff, transparent);
  margin: 8px 0 24px;
  border-radius: 2px;
}

/* ── Album ──────────────────────────────────────────────────── */
.mc-album-header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 14px 10px;
}
.mc-album-title {
  font-size: 20px; font-weight: 700; color: #3d2e22;
}
.mc-album-count {
  font-size: 12px; color: #b09a86;
}
.mc-album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.mc-album-grid img {
  width: 100%; aspect-ratio: 1;
  object-fit: cover;
  display: block;
  cursor: pointer;
}
.mc-album-empty {
  text-align: center;
  color: #b09a86;
  font-size: 13px;
  padding: 60px 20px;
}

/* Album viewer */
.mc-album-viewer {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 10000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.mc-album-viewer-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none;
  font-size: 28px; color: #fff;
  cursor: pointer; z-index: 2;
}
.mc-album-viewer-img {
  max-width: 90vw; max-height: 60vh;
  object-fit: contain;
  border-radius: 8px;
}
.mc-album-viewer-info {
  background: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  margin-top: 16px;
  max-width: 90vw; width: 320px;
}
.mc-album-viewer-desc {
  font-size: 14px; font-style: italic; color: #3d2e22;
  line-height: 1.6; margin-bottom: 4px;
}
.mc-album-viewer-time {
  font-size: 12px; color: #b09a86;
}
.mc-album-viewer-prev, .mc-album-viewer-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff; font-size: 32px;
  width: 40px; height: 60px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.mc-album-viewer-prev { left: 8px; }
.mc-album-viewer-next { right: 8px; }

/* ── Zoom overlay ────────────────────────────────────────────── */
.mc-zoom-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 999;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  animation: mc-fadein 0.2s ease;
}
@keyframes mc-fadein { from { opacity: 0; } to { opacity: 1; } }
.mc-zoom-overlay img {
  max-width: 94vw; max-height: 94vh;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  object-fit: contain;
}
.mc-zoom-close {
  position: absolute; top: 16px; right: 20px;
  color: #fff; font-size: 32px; font-weight: 300;
  cursor: pointer; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1); border-radius: 50%;
  transition: background 0.15s;
}
.mc-zoom-close:hover { background: rgba(255,255,255,0.25); }
.mc-clickable-img { cursor: pointer; transition: transform 0.15s; }
.mc-clickable-img:hover { transform: scale(1.02); }

/* Toast */
.mc-toast {
  position: fixed;
  top: 16px; left: 50%;
  transform: translateX(-50%) translateY(-16px);
  background: rgba(61,46,34,0.9);
  color: #fff;
  font-size: 13px; font-weight: 500;
  padding: 10px 20px;
  border-radius: 10px;
  max-width: 90vw;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
  pointer-events: none;
}
.mc-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── M2 Genesis new class names ──────────────────────────────── */
.mc-genesis-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: #a07898; margin-bottom: 8px;
}
.mc-genesis-title {
  font-size: 26px; font-weight: 800; color: #3d2e22;
  line-height: 1.25; margin-bottom: 10px;
}
.mc-genesis-sub {
  font-size: 13px; color: #9a8878; line-height: 1.55;
}
.mc-genesis-input {
  width: 100%;
  background: #fdf5ff;
  border: 2px solid #ecddf8;
  border-radius: 14px;
  color: #3d2d50;
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  line-height: 1.6;
  padding: 14px 16px;
  resize: none;
  min-height: 96px;
  transition: border-color 0.18s, box-shadow 0.18s;
  box-sizing: border-box;
}
.mc-genesis-input::placeholder { color: #cbb8e0; }
.mc-genesis-input:focus {
  outline: none;
  border-color: #c07cd8;
  box-shadow: 0 0 0 3px rgba(192,124,216,0.12);
}
.mc-genesis-chips { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 7px; }
.mc-genesis-chip {
  background: #fdf0ff;
  border: 1.5px solid #e8d0f8;
  border-radius: 20px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  color: #a070c8;
  cursor: pointer;
  transition: all 0.14s;
  user-select: none;
}
.mc-genesis-chip:hover { background: #f5e0ff; border-color: #c8a0e8; }
.mc-genesis-chip:active { transform: scale(0.96); }
.mc-genesis-world-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.mc-genesis-world {
  background: #fdf8ff;
  border: 2px solid #e8d4f8;
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.mc-genesis-world:hover {
  border-color: #c8a4e8;
  background: #fbf0ff;
  transform: translateY(-1px);
}
.mc-genesis-world.selected {
  border-color: #c07cd8;
  background: linear-gradient(135deg, #fce0f8, #f0dcff);
  box-shadow: 0 2px 12px rgba(192,124,216,0.20);
}
.mc-genesis-world-emoji { font-size: 22px; display: block; }
.mc-genesis-world-name {
  font-size: 11px;
  font-weight: 700;
  color: #5a3a7a;
  line-height: 1.3;
}
.mc-genesis-summon {
  display: block; width: 100%;
  background: linear-gradient(135deg, #f4a0bf 0%, #c490e8 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.5px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.18s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-align: center;
  box-shadow: 0 4px 16px rgba(200,120,210,0.30);
  margin-top: 20px;
}
.mc-genesis-summon:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(200,120,210,0.38); }
.mc-genesis-summon:active { transform: translateY(0); }
.mc-genesis-summon:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
@media (min-width: 640px) {
  .mc-genesis-world-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .mc-genesis-world-grid { grid-template-columns: repeat(6, 1fr); }
  .mc-genesis-world { padding: 14px 8px; }
  .mc-genesis-world-emoji { font-size: 26px; }
  .mc-genesis-world-name { font-size: 12px; }
}

/* ── M3 Summon loading screen ─────────────────────────────────── */
.mc-summon-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 40px 24px;
  text-align: center;
}
.mc-summon-rings {
  position: relative;
  width: 120px; height: 120px;
  margin: 0 auto 32px;
  display: flex; align-items: center; justify-content: center;
}
.mc-summon-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
  animation: mc-summon-spin linear infinite;
}
.mc-summon-ring.r1 {
  width: 120px; height: 120px;
  border-top-color: rgba(192,124,216,0.6);
  border-right-color: rgba(192,124,216,0.2);
  animation-duration: 2.4s;
}
.mc-summon-ring.r2 {
  width: 88px; height: 88px;
  border-top-color: rgba(244,160,191,0.7);
  border-left-color: rgba(244,160,191,0.2);
  animation-duration: 1.8s;
  animation-direction: reverse;
}
.mc-summon-ring.r3 {
  width: 58px; height: 58px;
  border-top-color: rgba(168,200,255,0.8);
  border-bottom-color: rgba(168,200,255,0.2);
  animation-duration: 1.2s;
}
@keyframes mc-summon-spin {
  to { transform: rotate(360deg); }
}
.mc-summon-core {
  position: relative;
  font-size: 28px;
  animation: mc-summon-pulse 2s ease-in-out infinite;
}
@keyframes mc-summon-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}
.mc-summon-realm-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  color: #b090d0;
  background: rgba(192,124,216,0.12);
  border-radius: 20px;
  padding: 4px 14px;
  margin-bottom: 16px;
}
.mc-summon-text {
  font-size: 15px; font-weight: 600; color: #7a5a9a;
  line-height: 1.5; margin-bottom: 20px;
}
.mc-summon-dots {
  display: flex; gap: 8px; justify-content: center;
}
.mc-summon-dot {
  width: 8px; height: 8px;
  background: #c490e8;
  border-radius: 50%;
  animation: mc-summon-dot-bounce 1.2s ease-in-out infinite;
}
.mc-summon-dot:nth-child(2) { animation-delay: 0.2s; }
.mc-summon-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes mc-summon-dot-bounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* ── M4 ID Card reveal layout ─────────────────────────────────── */
.mc-idcard-reveal-top {
  text-align: center;
  padding: 24px 0 20px;
}
.mc-idcard-reveal-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: #a07898;
  margin-bottom: 8px;
}
.mc-idcard-reveal-avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 20px rgba(180,140,110,0.20);
  margin: 12px auto;
  display: block;
}
.mc-idcard-reveal-species {
  font-size: 13px; font-weight: 700; color: #7a5a9a;
  margin-bottom: 6px;
}
.mc-idcard-reveal-desc {
  font-size: 12px; color: #9a8878; line-height: 1.6;
  padding: 0 16px;
}
.mc-idcard-name-section {
  margin: 20px 0;
}
.mc-idcard-name-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  color: #9a8878; margin-bottom: 8px;
}
.mc-idcard-name-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid #e8d4f8;
  color: #3d2d50;
  font-size: 22px; font-weight: 800;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding: 4px 0 8px;
  text-align: center;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.mc-idcard-name-input::placeholder { color: #d8c8e8; }
.mc-idcard-name-input:focus { outline: none; border-bottom-color: #c07cd8; }
.mc-idcard-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center; margin: 14px 0;
}
.mc-idcard-actions {
  display: flex; gap: 10px; margin-top: 24px;
}
.mc-idcard-abandon {
  flex: 1;
  background: #fff;
  color: #b09a86;
  border: 2px solid #f0e6da;
  border-radius: 50px;
  font-size: 13px; font-weight: 700;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.mc-idcard-abandon:hover { border-color: #e0cabb; color: #8a7a6a; }
.mc-idcard-confirm {
  flex: 2;
  background: linear-gradient(135deg, #f4a0bf 0%, #c490e8 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 14px; font-weight: 700;
  padding: 14px;
  cursor: pointer;
  transition: all 0.18s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-shadow: 0 4px 16px rgba(200,120,210,0.28);
}
.mc-idcard-confirm:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(200,120,210,0.38); }
.mc-idcard-confirm:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ── M5 Anchor waiting section ────────────────────────────────── */
.mc-anchor-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px;
  text-align: center;
}
.mc-anchor-name {
  font-size: 22px; font-weight: 800; color: #3d2e22;
  margin: 12px 0 16px;
}
.mc-anchor-progress {
  width: 100%; max-width: 240px;
  height: 6px;
  background: #f0e6da;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}
.mc-anchor-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f4b8a0, #e8857a);
  border-radius: 3px;
  animation: mc-anchor-fill 6s ease-in-out infinite alternate;
}
@keyframes mc-anchor-fill {
  0% { width: 15%; }
  100% { width: 85%; }
}
.mc-anchor-text {
  font-size: 14px; color: #7a6858; line-height: 1.6;
  margin-bottom: 8px;
}
.mc-anchor-sub {
  font-size: 12px; color: #b09a86;
}
