/* ================= NHIỆM VỤ NGÀY & TUẦN ================= */
.ms-tabs .tab-btn { position: relative; }
.tab-dot {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; margin-left: 5px; padding: 0 4px;
  font-size: 10.5px; font-weight: 900; color: #fff;
  background: var(--danger); border: 1.5px solid #fff; border-radius: 99px;
  vertical-align: 1px;
}

.ms-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; margin-bottom: 10px;
  border: 2.5px solid var(--outline); border-radius: 16px;
  color: #fff;
  box-shadow: 0 3px 0 var(--outline);
}
.ms-head.daily { background: linear-gradient(90deg, #f76707, #f59f00); }
.ms-head.weekly { background: linear-gradient(90deg, #7048e8, #ae3ec9); }
.ms-title { font-size: 19px; font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.3); }
.ms-sub { font-size: 12.5px; font-weight: 600; opacity: .97; margin-top: 2px; }
.ms-cd { font-variant-numeric: tabular-nums; background: rgba(0,0,0,.25); border-radius: 6px; padding: 0 6px; }

/* Thanh điểm năng động + rương mốc */
.ms-activity {
  padding: 10px 14px 10px; margin-bottom: 10px;
  background: #fff; border: 2px solid var(--outline); border-radius: 14px;
}
.ms-act-label { font-size: 13px; font-weight: 700; }
.ms-act-label b { color: #e67700; font-size: 15px; }
.ms-act-label small { color: var(--muted); font-weight: 600; }
.ms-track { position: relative; height: 54px; margin: 6px 22px 2px 4px; }
.ms-track-bar {
  position: absolute; left: 0; right: 0; top: 20px; height: 12px;
  background: #e9ecef; border: 2px solid var(--outline); border-radius: 99px; overflow: hidden;
}
.ms-track-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd43b, #f59f00); transition: width .4s; }
.ms-chest {
  position: absolute; top: 2px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  width: 46px;
  font-family: inherit; background: none; border: 0; cursor: pointer; padding: 0;
}
.mc-icon {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  background: #fff; border: 2.5px solid var(--outline); border-radius: 12px;
  box-shadow: 0 2px 0 var(--outline);
  transition: transform .12s;
}
.mc-need { font-size: 10.5px; font-weight: 900; color: #495057; margin-top: 1px; }
.ms-chest.locked .mc-icon { filter: grayscale(.85); opacity: .7; }
.ms-chest.ready .mc-icon { background: linear-gradient(180deg, #fff3bf, #ffd43b); animation: chest-shake 1.2s ease-in-out infinite; box-shadow: 0 2px 0 var(--outline), 0 0 12px rgba(250,176,5,.8); }
.ms-chest.claimed .mc-icon { background: #d3f9d8; }
.ms-chest:hover .mc-icon { transform: translateY(-2px); }
@keyframes chest-shake { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-12deg) scale(1.1); } 86% { transform: rotate(10deg) scale(1.1); } 94% { transform: rotate(-5deg); } }

.ms-chest-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px 10px; margin-top: 6px; }
.ms-chest-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap;
  padding: 4px 8px; border-radius: 9px; background: #f8f9fa; border: 1.5px dashed #dee2e6;
  font-size: 12px;
}
.ms-chest-row.ready { background: #fff9db; border-color: #fab005; }
.ms-chest-row.claimed { opacity: .55; }
.mcr-name { font-weight: 800; }
.mcr-name small { color: var(--muted); }
.mcr-rw { display: flex; gap: 3px; flex-wrap: wrap; }

.ms-reroll-note { font-size: 12.5px; color: #495057; margin: 0 2px 8px; }
.ms-reroll-note small { color: var(--muted); }

/* Thẻ nhiệm vụ */
.ms-list { display: flex; flex-direction: column; gap: 8px; }
.ms-card {
  --tc: #40c057;
  display: grid; grid-template-columns: 50px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px;
  background: #fff;
  border: 2.5px solid var(--outline); border-left: 8px solid var(--tc);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--outline);
}
.ms-card.tier-normal { --tc: #339af0; }
.ms-card.tier-hard { --tc: #e8590c; }
.ms-card.ready { background: #ebfbee; animation: ready-glow 1.4s ease-in-out infinite; }
.ms-card.claimed { opacity: .6; background: #f1f3f5; }
.ms-icon {
  width: 50px; height: 50px; display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  background: color-mix(in srgb, var(--tc) 18%, #fff);
  border: 2px solid var(--tc); border-radius: 14px;
}
.ms-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ms-card-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ms-tier {
  font-size: 10.5px; font-weight: 900; color: #fff;
  background: var(--tc); border-radius: 6px; padding: 1px 7px;
}
.ms-name { font-weight: 900; font-size: 14.5px; }
.ms-desc { font-size: 12px; color: var(--muted); }
.ms-prog {
  position: relative; height: 18px;
  background: #e9ecef; border: 2px solid var(--outline); border-radius: 99px; overflow: hidden;
}
.ms-prog i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 55%, #fff), var(--tc)); transition: width .3s; }
.ms-prog span { position: relative; display: block; text-align: center; font-size: 11px; font-weight: 900; line-height: 14px; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.ms-rewards { display: flex; gap: 4px; flex-wrap: wrap; }
.rw {
  font-size: 11px; font-weight: 800;
  padding: 1px 7px; border-radius: 99px; border: 1.5px solid;
  white-space: nowrap;
}
.rw-vnd { background: #fff9db; border-color: #fab005; color: #7a5500; }
.rw-xu { background: #fff4e6; border-color: #fd7e14; color: #a14d00; }
.rw-exp { background: #f3f0ff; border-color: #845ef7; color: #5f3dc4; }
.rw-item { background: #e6fcf5; border-color: #20c997; color: #087f5b; }
.rw-pts { background: #ffe8cc; border-color: #f76707; color: #c2410c; }
.ms-actions { display: flex; flex-direction: column; gap: 5px; align-items: stretch; min-width: 108px; }
.ms-done { font-weight: 900; color: #2b8a3e; text-align: center; }

/* Bảng theo dõi nhỏ trên phố */
.mission-tracker {
  position: absolute; top: 108px; left: 12px; z-index: 3;
  width: 286px;
  line-height: normal;
  background: rgba(255, 253, 246, 0.94);
  border: 2.5px solid var(--outline); border-radius: 14px;
  box-shadow: 0 3px 0 var(--outline), 0 8px 18px rgba(0,0,0,.18);
  cursor: pointer;
  overflow: hidden;
  transition: transform .12s;
}
.mission-tracker:hover { transform: translateY(-1px); }
.mt-head {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px;
  background: linear-gradient(90deg, #f76707, #f59f00);
  color: #fff; font-size: 12px; font-weight: 800;
  text-shadow: 0 1px 0 rgba(0,0,0,.3);
}
.mt-head > span:first-child { flex: 1; white-space: nowrap; }
.mt-pts { background: rgba(0,0,0,.22); border-radius: 99px; padding: 0 7px; }
.mt-ready {
  min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger); border: 1.5px solid #fff; border-radius: 99px; font-size: 10.5px;
  animation: badge-pulse 1s ease-in-out infinite;
}
.mt-toggle {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.7); background: rgba(0,0,0,.18); color: #fff;
  font-size: 11px; cursor: pointer; line-height: 1;
  transition: transform .2s;
}
.mission-tracker.collapsed .mt-toggle { transform: rotate(-90deg); }
.mission-tracker.collapsed .mt-list { display: none; }
.mt-list { padding: 5px 6px 6px; display: flex; flex-direction: column; gap: 4px; }
.mt-row {
  position: relative;
  display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 5px;
  padding: 3px 6px 5px; border-radius: 8px; background: #fff; border: 1.5px solid #e9ecef;
  font-size: 11.5px; font-weight: 700;
  overflow: hidden;
}
.mt-row.done { background: #ebfbee; border-color: #8ce99a; }
.mt-row.all-done { display: block; text-align: center; color: #2b8a3e; }
.mt-icon { font-size: 14px; }
.mt-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-num { font-weight: 900; color: #495057; font-size: 11px; }
.mt-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #ffd43b, #f76707); }

@media (max-width: 760px) {
  .ms-card { grid-template-columns: 40px 1fr; }
  .ms-icon { width: 40px; height: 40px; font-size: 21px; }
  .ms-actions { grid-column: 1 / -1; flex-direction: row; }
  .ms-chest-list { grid-template-columns: 1fr; }
  .ms-head { flex-direction: column; align-items: stretch; }
  .mission-tracker { width: 210px; }
}
@media (prefers-reduced-motion: reduce) {
  .ms-chest.ready .mc-icon, .mt-ready { animation: none; }
}

/* ===== Gợi ý & nơi làm nhiệm vụ ===== */
.task-guide {
  display: flex; flex-direction: column; gap: 3px;
  padding: 5px 8px; border-radius: 9px;
  background: #f1f8ff; border: 1.5px dashed #74c0fc;
  font-size: 11.5px; line-height: 1.4;
}
.tg-where { font-weight: 800; color: #1864ab; }
.tg-hint { color: #495057; }

/* ===== Cốt truyện mở dần ===== */
.story-head {
  display: flex; flex-direction: column; gap: 5px;
  padding: 10px 14px; margin-bottom: 10px;
  background: #fff9db; border: 2px solid var(--outline); border-radius: 14px;
  font-size: 13.5px;
}
.story-head small { color: var(--muted); font-size: 11.5px; }
.story-prog { --tc: #f59f00; }
.quest-row .ms-prog { --tc: #339af0; margin: 4px 0; }
.quest-row.q-ready .ms-prog { --tc: #2b8a3e; }
.quest-row.q-locked { opacity: .62; background: #f1f3f5; filter: grayscale(.5); }
.q-lock-note { font-size: 11.5px; color: #868e96; font-style: italic; margin: 2px 0; }
.q-section { margin: 8px 2px 2px; font-size: 12.5px; font-weight: 900; color: #495057; }
.quest-action { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.q-skip-note { font-size: 10.5px; color: var(--muted); text-align: center; }
.quest-row .task-guide { margin: 4px 0 2px; }
